$(function () {
    window.$containerObj = {
        main: $('#container'),  // container元素
        data: {}, // hospital、type、assets、year数据
        init: function () {
            this.maintenanceType = '1';
            $headerObj.searchObj.params.maintenanceType = '1';
            this.totalObj.init(); // 初始化 概览框 对象
            this.chartObj.init(); // 初始化 echart 对象
            this.modalObj.init(); // 初始化 详情模态框 对象
        },
        /* 查询hospital、type、assets、year数据 */
        queryData: function (tag, params, fn, seriesIndex) { // tag: hospital、type、assets、year, params: 筛选条件, fn: 回调函数
            var $this = this;
            var url = basePath + 'charts/area/maintenance/' + tag;
            publicAjax(url, 'post', $.extend({}, $headerObj.searchObj.params, params || {}), function (data) {
                $this.data[tag] = data.data && data.data.list ? data.data : {list: []};  // 设置$containerObj对象data数据
                $this.data[tag].list.calTotal();  // 计算总数，按照curPrice排序
                // 设置模态框数据
                $this.modalObj.data[tag] = $.extend(true, {}, $this.data[tag]);
                if (fn) {fn();} else {
                    if (tag === 'type') {  // 设置echart图表数据
                        $this.chartObj.convertData(); // chartObj转换echart所用数据
                        $this.chartObj.setChart();  // chartObj设置echart图表
                    }
                    // 获取数据长度，用于计算TOP5显示条数
                    var length = tag === 'type'
                        ? $this.data[tag].list[-1].list ? $this.data[tag].list[-1].list.length : 0
                        : $this.data[tag].list.length;
                    $this.top5Obj.convertData(tag, 0, length > 5 ? 5 : length, -1, seriesIndex); // top5Obj转化数据，及设置TOP5列表
                    /* 如果模态框显示则刷新模态框数据 */
                    if ($this.modalObj.main.is(':visible') || $this.modalObj.yearMain.is(':visible')) {
                        $this.modalObj.setModal($this.modalObj.main.data().tag, 'curPrice', 'desc');
                    }
                }
                if (seriesIndex !== undefined) loading(true);
            }, true);
        },
        /* 点击TOP5列表及详情模态框跳转关系 */
        query: function (tag, id) {
            var $this = this;
            if (tag === 'hospital') { // 如果是医院就跳转到医院报表
                window.open(basePath + 'charts/hospital/hospital-maintenance/page?hospitalId=' + id);
            } else if (tag === 'type') {  // 如果是设备类型，设置设备类型参数，并跳转到设备型号页面
                location.href = basePath + 'charts/area/maintenance/model-page?typeId=' + id;
            } else if (tag === 'assets') {  // 如果是具体设备就跳转到设备详情页面
                window.open(basePath + 'charts/overview/assets/page?deviceId=' + id);
            } else if (tag === 'year') {  // 如果是历年数据，筛选年份数据
                loading(function () {
                    $this.queryData('type', {monthId: id}, function () {
                        $this.modalObj.setModal('type', '', 'desc', ',monthId:' + id);
                    });
                });
            }
        }
    };
    /* 概览框对象 */
    $containerObj.totalObj = {
        main: $containerObj.main.find('.main-total'), // 概览框元素
        data: {}, // 概览框数据
        init: function () {
            this.queryData(); // 查询概览框数据
        },
        /* 查询概览框数据 flag：点击气泡时，传true，只查询除气泡图以外的数据 */
        queryData: function (flag, seriesIndex) {
            var $this = this;
            $headerObj.searchObj.params.maintenanceType = $containerObj.maintenanceType;
            if (flag) { // flag：点击气泡时，传true，只查询除气泡图以外的数据
                $containerObj.queryData('hospital', false, false, seriesIndex);
                $containerObj.queryData('assets', false, false, seriesIndex);
            } else {
                $containerObj.queryData('hospital', false, false, seriesIndex);
                $containerObj.queryData('type', false, false, seriesIndex);
                $containerObj.queryData('assets', false, false, seriesIndex);
                // 触发 历年数据、全部数据 下拉框，使页面显示全部数据
                $containerObj.chartObj.changeSelect.val(0).trigger('change');
                publicAjax(basePath + 'charts/area/maintenance/overview-hospital', 'post', $headerObj.searchObj.params, function (data) {
                    $this.data = data.data;
                    $this.setData();  // 设置数据
                }, true);
            }
        },
        /* 设置概览框数据 */
        setData: function () {
            // 设置标题设备金额范围
            var totalTitle = this.main.find('.total-title');
            totalTitle.off().on('click', function () {
                loading();
                var index = $(this).index('.total-title');
                $containerObj.maintenanceType = 3 - index + '';
                $headerObj.searchObj.params.maintenanceType = $containerObj.maintenanceType;
                totalTitle.removeClass('active').eq(index).addClass('active');
                if ($containerObj.chartObj.changeSelect.val() === '1') {
                    $containerObj.chartObj.changeSelect.trigger('change');
                } else {
                    $containerObj.queryData('hospital');
                    $containerObj.queryData('type');
                    $containerObj.queryData('assets');
                }
            });
            // 强检情况
            var compulsoryOverview = this.data.compulsoryOverview || {};
            this.main.find('#total-value-1-1').text(fix2(compulsoryOverview.CompulsoryTimelyPercentage));  // 强检及时率
            this.main.find('#total-value-1-2').text(fix0(compulsoryOverview.hospitalNum));  // 医院数量
            this.main.find('#total-value-1-3').text(fix0(compulsoryOverview.CompulsoryDateCount));  // 计划强检数
            this.main.find('#total-value-1-4').text(fix0(compulsoryOverview.CompulsoryVerificationCount));  // 实际强检数
            this.main.find('#total-value-1-5').text(fix2(compulsoryOverview.jnCompulsoryPercentage));  // 强检率
            this.main.find('#total-value-1-6').text(Math.abs(fix2(compulsoryOverview.tbCompulsoryPercentage)))  // 同比
                .next().find('img').attr('src', compulsoryOverview.tbCompulsoryPercentage >= 0
                ? basePath + 'plugins/charts/images/arrow_up.png'
                : basePath + 'plugins/charts/images/arrow_down.png'
            );
            // 巡检情况
            var inspectionOverview = this.data.inspectionOverview || {};
            this.main.find('#total-value-2-1').text(fix2(inspectionOverview.inspectionTimelyPercentage));  // 巡检及时率
            this.main.find('#total-value-2-2').text(fix0(inspectionOverview.hospitalNum));  // 医院数量
            this.main.find('#total-value-2-3').text(fix0(inspectionOverview.inspectionDateCount));  // 计划巡检数
            this.main.find('#total-value-2-4').text(fix0(inspectionOverview.inspectionInfoCount));  // 实际强检数
            this.main.find('#total-value-2-5').text(fix2(inspectionOverview.jnInspectionPercentage));  // 巡检率
            this.main.find('#total-value-2-6').text(Math.abs(fix2(inspectionOverview.tbInspectionPercentage)))  // 同比
                .next().find('img').attr('src', inspectionOverview.tbInspectionPercentage >= 0
                ? basePath + 'plugins/charts/images/arrow_up.png'
                : basePath + 'plugins/charts/images/arrow_down.png'
            );
            // 保养情况
            var upkeepOverview = this.data.upkeepOverview || {};
            this.main.find('#total-value-3-1').text(fix2(upkeepOverview.upkeepTimelyPercentage));  // 保养及时率
            this.main.find('#total-value-3-2').text(fix0(upkeepOverview.hospitalNum));  // 医院数量
            this.main.find('#total-value-3-3').text(fix0(upkeepOverview.upkeepDateCount));  // 计划保养数
            this.main.find('#total-value-3-4').text(fix0(upkeepOverview.upkeepInfoCount));  // 实际保养数
            this.main.find('#total-value-3-5').text(fix2(upkeepOverview.jnUpkeepPercentage));  // 保养率
            this.main.find('#total-value-3-6').text(Math.abs(fix2(upkeepOverview.tbUpkeepPercentage)))  // 同比
                .next().find('img').attr('src', upkeepOverview.tbUpkeepPercentage >= 0
                ? basePath + 'plugins/charts/images/arrow_up.png'
                : basePath + 'plugins/charts/images/arrow_down.png'
            );
        }
    };
    /* echart对象 */
    $containerObj.chartObj = {
        main: $containerObj.main.find('.main-chart'), // echarts图表模块主元素
        changeSelect: $('#chart-change'), // 历年数据/全部数据 下拉框
        data: { // echarts图表数据
            seriesData: [],
            xAxis: []
        },
        yearData: { // 历年数据
            seriesData: [],
            xAxis: []
        },
        init: function () {
            this.initChart(); // 初始化echats图表
            this.bindEvent(); // 绑定事件
        },
        /* 初始化echarts图表 */
        initChart: function () {
            this.chart = echarts.init(this.main.find('#chart')[0]);
            this.chart.on('click', this.click.bind(this));  // echarts绑定click事件
        },
        /* echarts图表click事件，点击气泡，top5高亮，筛选其他数据 */
        click: function (params) {
            var $this = this;
            if ((params.componentType !== 'markLine') && (this.changeSelect.val() !== '1')) { // 点击的不是平均线及历年数据不显示
                loading();
                setTimeout(function () {
                    var seriesIndex = params.seriesIndex,
                        index = -1, // 点击气泡图的index
                        id = $containerObj.data.type.list[-1].list.getIdByName(params.name),
                        length = $containerObj.data.type.list[-1].list.length; // 医院列表的长度
                    /* 点击的气泡已经筛选了，就取消高亮，没筛选就加上高亮 */
                    var selectType = $('.select_type'); // type筛选框
                    if ((selectType.val() || []).join(',') === [id].join(',')) {
                        selectType.val('').trigger('change');
                        $headerObj.searchObj.params.typeId = '';
                        $containerObj.totalObj.queryData(true, seriesIndex);
                        index = -1;
                    } else {
                        selectType.val(id).trigger('change');
                        $headerObj.searchObj.params.typeId = JSON.stringify([id]);
                        $containerObj.totalObj.queryData(true, seriesIndex);
                        if ($containerObj.maintenanceType === '1') {    // 保养
                            ($containerObj.data.type.list[-1].list || []).sortByKey(seriesIndex === 4 ? 'upkeepTimelyPercentage' : 'jnUpkeepPercentage');
                        } else if ($containerObj.maintenanceType === '2') {    // 巡检
                            ($containerObj.data.type.list[-1].list || []).sortByKey(seriesIndex === 4 ? 'inspectionTimelyPercentage' : 'jnInspectionPercentage');
                        } else if ($containerObj.maintenanceType === '3') {    // 强检
                            ($containerObj.data.type.list[-1].list || []).sortByKey(seriesIndex === 4 ? 'compulsoryTimelyPercentage' : 'jnCompulsoryPercentage');
                        }
                        index = $containerObj.data.type.list[-1].list.getIndexByKey('id', id);
                    }
                    var optionB = $this.optionChart;
                    if (params.seriesType === 'line') {
                        if ($this.copySatus) {
                            $this.optionBTemp = $.extend(true, {}, optionB);
                            $this.optionBTempTemp = $.extend(true, {}, optionB);
                        } else {
                            $this.optionBTemp = {};
                            $this.optionBTemp = $.extend(true, {}, $this.optionBTempTemp);
                        }
                        $this.copySatus = false;
                        if ($this.optionBTemp.series[seriesIndex].type === 'bar') {
                            $this.optionBTemp.series[seriesIndex].itemStyle.normal.opacity = 1;
                        } else if ($this.optionBTemp.series[seriesIndex].type === 'line') {
                            $this.optionBTemp.series[seriesIndex].lineStyle.normal.width = 4;
                            $this.optionBTemp.series[seriesIndex].z = 10;
                        }
                        $this.chart.setOption($this.optionBTemp);
                    }
                    /* 设置top5数据 */
                    if (length > 5) {
                        if (index > length - 3) {
                            $containerObj.top5Obj.convertData('type', length - 5, length, index, seriesIndex);
                        }
                        if (index < 2) {
                            $containerObj.top5Obj.convertData('type', 0, length > 5 ? 5 : length, index, seriesIndex);
                        } else {
                            $containerObj.top5Obj.convertData('type', index - 2, index + 3, index, seriesIndex);
                        }
                    } else {
                        $containerObj.top5Obj.convertData('type', 0, length, index, seriesIndex);
                    }
                }, 10);
            }
        },
        /* 转换echarts数据 */
        convertData: function () {
            var data = $containerObj.data.type;
            data.list[-1].list = data.list[-1].list || [];
            this.data.seriesData = [[], [], [], [], []];
            this.data.xAxis = [];
            if ($containerObj.maintenanceType === '1') {    // 保养
                for (var i = 0; i < data.list.length; i++) {
                    this.data.seriesData[0].push(fixLine(data.list[-1].list[i].jnUpkeepDateCount));
                    this.data.seriesData[1].push(fixLine(data.list[-1].list[i].jnUpkeepInfoCount));
                    this.data.seriesData[2].push(fixLine(data.list[-1].list[i].jnUpkeepPercentage));
                    this.data.seriesData[3].push(fixLine(data.list[-1].list[i].tbUpkeepPercentage));
                    this.data.seriesData[4].push(fixLine(data.list[-1].list[i].upkeepTimelyPercentage));
                    this.data.xAxis.push(fixStr(data.list[-1].list[i].name));
                }
                this.optionChart.legend.data = [$.i18n.prop('maintenance.overview.jhbys'), $.i18n.prop('maintenance.overview.sjbys'), $.i18n.prop('maintenance.overview.byl'), $.i18n.prop('maintenance.overview.byjsl')];
                this.optionChart.series[0].name = $.i18n.prop('maintenance.overview.jhbys');
                this.optionChart.series[1].name = $.i18n.prop('maintenance.overview.sjbys');
                this.optionChart.series[2].name = $.i18n.prop('maintenance.overview.byl');
                this.optionChart.series[3].name = $.i18n.prop('maintenance.charts.byltb');
                this.optionChart.series[4].name = $.i18n.prop('maintenance.overview.byjsl');
            } else if ($containerObj.maintenanceType === '2') {    // 巡检
                for (var i = 0; i < data.list.length; i++) {
                    this.data.seriesData[0].push(fixLine(data.list[-1].list[i].jnInspectionDateCount));
                    this.data.seriesData[1].push(fixLine(data.list[-1].list[i].jnInspectionInfoCount));
                    this.data.seriesData[2].push(fixLine(data.list[-1].list[i].jnInspectionPercentage));
                    this.data.seriesData[3].push(fixLine(data.list[-1].list[i].tbInspectionPercentage));
                    this.data.seriesData[4].push(fixLine(data.list[-1].list[i].inspectionTimelyPercentage));
                    this.data.xAxis.push(fixStr(data.list[-1].list[i].name));
                }
                this.optionChart.legend.data = [$.i18n.prop('maintenance.overview.jhxjs'), $.i18n.prop('maintenance.overview.sjxjs'), $.i18n.prop('maintenance.overview.xjl'), $.i18n.prop('maintenance.overview.xjjsl')];
                this.optionChart.series[0].name = $.i18n.prop('maintenance.overview.jhxjs');
                this.optionChart.series[1].name = $.i18n.prop('maintenance.overview.sjxjs');
                this.optionChart.series[2].name = $.i18n.prop('maintenance.overview.xjl');
                this.optionChart.series[3].name = $.i18n.prop('maintenance.charts.xjltb');
                this.optionChart.series[4].name = $.i18n.prop('maintenance.overview.xjjsl');
            } else if ($containerObj.maintenanceType === '3') {    // 强检
                for (var i = 0; i < data.list.length; i++) {
                    this.data.seriesData[0].push(fixLine(data.list[-1].list[i].jnCompulsoryDateCount));
                    this.data.seriesData[1].push(fixLine(data.list[-1].list[i].jnCompulsoryVerificationCount));
                    this.data.seriesData[2].push(fixLine(data.list[-1].list[i].jnCompulsoryPercentage));
                    this.data.seriesData[3].push(fixLine(data.list[-1].list[i].tbCompulsoryPercentage));
                    this.data.seriesData[4].push(fixLine(data.list[-1].list[i].compulsoryTimelyPercentage));
                    this.data.xAxis.push(fixStr(data.list[-1].list[i].name));
                }
                this.optionChart.legend.data = [$.i18n.prop('maintenance.overview.jhqjs'), $.i18n.prop('maintenance.overview.sjqjs'), $.i18n.prop('maintenance.overview.qjl'), $.i18n.prop('maintenance.overview.qjjsl')];
                this.optionChart.series[0].name = $.i18n.prop('maintenance.overview.jhqjs');
                this.optionChart.series[1].name = $.i18n.prop('maintenance.overview.sjqjs');
                this.optionChart.series[2].name = $.i18n.prop('maintenance.overview.qjl');
                this.optionChart.series[3].name = $.i18n.prop('maintenance.charts.qjltb');
                this.optionChart.series[4].name = $.i18n.prop('maintenance.overview.qjjsl');
            }

        },
        /* 设置echarts图表 */
        setChart: function () {
            this.optionChart.series[0].data = this.data.seriesData[0];
            this.optionChart.series[1].data = this.data.seriesData[1];
            this.optionChart.series[2].data = this.data.seriesData[2];
            this.optionChart.series[3].data = this.data.seriesData[3];
            this.optionChart.series[4].data = this.data.seriesData[4];
            this.optionChart.xAxis.data = this.data.xAxis;
            this.optionChart.dataZoom.end = this.data.xAxis.length > 12 ? 1200 / this.data.xAxis.length : 100;    //图表滚动条

            this.chart.clear();
            this.chart.setOption(this.optionChart);

            this.copySatus = true;
        },
        /* 查询历年数据 */
        queryYearData: function () {
            var $this = this;
            publicAjax(basePath + 'charts/area/maintenance/month-trend', 'post', $headerObj.searchObj.params, function (data) {
                $containerObj.data.year = data.data;
                $containerObj.data.year.list.calTotal();
                $this.convertYearData();
                $this.setYearChart();
                $containerObj.top5Obj.convertData('year', 0, data.data.list.length);
                // 设置模态框数据
                $containerObj.modalObj.data.year = $.extend(true, {}, $containerObj.data.year);
                loading(true);
            }, true);
        },
        /* 转换历年数据 */
        convertYearData: function () {
            var data = $containerObj.data.year;
            this.yearData.xAxis = [];
            this.yearData.seriesData = [[], [], [], []];
            if ($containerObj.maintenanceType === '1') {
                for (var i = 0; i < data.list.length; i++) {
                    this.yearData.xAxis.push(data.list[i].monthName);
                    this.yearData.seriesData[0].push(data.list[i].upkeepDateCount);
                    this.yearData.seriesData[1].push(data.list[i].upkeepInfoCount);
                    this.yearData.seriesData[2].push(data.list[i].upkeepPercentage);
                    this.yearData.seriesData[3].push(data.list[i].upkeepTimelyPercentage);
                }
                this.optionYear.legend.data = [$.i18n.prop('maintenance.overview.jhbys'), $.i18n.prop('maintenance.overview.sjbys'), $.i18n.prop('maintenance.overview.byl'), $.i18n.prop('maintenance.charts.byltb')];
                this.optionYear.series[0].name = $.i18n.prop('maintenance.overview.jhbys');
                this.optionYear.series[1].name = $.i18n.prop('maintenance.overview.sjbys');
                this.optionYear.series[2].name = $.i18n.prop('maintenance.overview.byl');
                this.optionYear.series[3].name = $.i18n.prop('maintenance.charts.byltb');
            } else if ($containerObj.maintenanceType === '2') {
                for (var i = 0; i < data.list.length; i++) {
                    this.yearData.xAxis.push(data.list[i].monthName);
                    this.yearData.seriesData[0].push(data.list[i].inspectionDateCount);
                    this.yearData.seriesData[1].push(data.list[i].inspectionInfoCount);
                    this.yearData.seriesData[2].push(data.list[i].inspectionPercentage);
                    this.yearData.seriesData[3].push(data.list[i].inspectionTimelyPercentage);
                }
                this.optionYear.legend.data = [$.i18n.prop('maintenance.overview.jhxjs'), $.i18n.prop('maintenance.overview.sjxjs'), $.i18n.prop('maintenance.overview.xjl'), $.i18n.prop('maintenance.charts.xjltb')];
                this.optionYear.series[0].name = $.i18n.prop('maintenance.overview.jhxjs');
                this.optionYear.series[1].name = $.i18n.prop('maintenance.overview.sjxjs');
                this.optionYear.series[2].name = $.i18n.prop('maintenance.overview.xjl');
                this.optionYear.series[3].name = $.i18n.prop('maintenance.charts.xjltb');
            } else if ($containerObj.maintenanceType === '3') {
                for (var i = 0; i < data.list.length; i++) {
                    this.yearData.xAxis.push(data.list[i].monthName);
                    this.yearData.seriesData[0].push(data.list[i].compulsoryDateCount);
                    this.yearData.seriesData[1].push(data.list[i].compulsoryVerificationCount);
                    this.yearData.seriesData[2].push(data.list[i].compulsoryPercentage);
                    this.yearData.seriesData[3].push(data.list[i].compulsoryTimelyPercentage);
                }
                this.optionYear.legend.data = [$.i18n.prop('maintenance.overview.jhqjs'), $.i18n.prop('maintenance.overview.sjqjs'), $.i18n.prop('maintenance.overview.qjl'), $.i18n.prop('maintenance.charts.qjltb')];
                this.optionYear.series[0].name = $.i18n.prop('maintenance.overview.jhqjs');
                this.optionYear.series[1].name = $.i18n.prop('maintenance.overview.sjqjs');
                this.optionYear.series[2].name = $.i18n.prop('maintenance.overview.qjl');
                this.optionYear.series[3].name = $.i18n.prop('maintenance.charts.qjltb');
            }
        },
        /* 设置历年数据echarts图表 */
        setYearChart: function () {
            this.optionYear.xAxis.data = this.yearData.xAxis;
            this.optionYear.series[0].data = this.yearData.seriesData[0];
            this.optionYear.series[1].data = this.yearData.seriesData[1];
            this.optionYear.series[2].data = this.yearData.seriesData[2];
            this.optionYear.series[3].data = this.yearData.seriesData[3];

            this.chart.clear();
            this.chart.setOption(this.optionYear);
            loading(true);
        },
        /* 绑定事件 */
        bindEvent: function () {
            var $this = this;
            var yearBtn = this.main.find('.year-btn'),
                chartTitle = this.main.find('.chart-title');
            yearBtn.on('click', function () {
                var value = 1 - parseInt($this.changeSelect.val());
                $this.changeSelect.val(value).trigger('change');
            });
            /* 历年数据/全部显示 下拉框change事件 */
            this.changeSelect.on('change', function () {
                var value = parseInt($(this).val());
                loading(function () {
                    if (value) {
                        yearBtn.addClass('active').find('span').html($.i18n.prop('charts.button.qbxs'));
                        chartTitle.html($.i18n.prop('charts.button.yfxs')).data().tag = 'year';
                        $this.main.find('.quadrantContainner').hide();
                        $containerObj.top5Obj.changeShow(value);
                        $this.queryYearData();
                    } else {
                        yearBtn.removeClass('active').find('span').html($.i18n.prop('charts.button.yfxs'));
                        chartTitle.html($.i18n.prop('charts.title.yljgfb')).data().tag = 'hospital';
                        $this.main.find('.quadrantContainner').show();
                        $containerObj.top5Obj.changeShow(value);
                        $containerObj.queryData('type', false, false, -1);
                    }
                });
            });

            /* 处理象限点击 */
            var currentOptionTemp,
                optionAgelimit = this.optionChart;
            this.main.find('.quadrant').on('click', function () {
                var index = $(this).index();
                var arr = optionAgelimit.series[0].data;
                var markLimeArr = optionAgelimit.series[0].markLine.data;
                var arrTemp = [];
                currentOptionTemp = optionAgelimit;
                if ($(this).hasClass('active')) {
                    $(this).removeClass('active');
                    arrTemp = arr;
                    currentOptionTemp.series[0].markLine.data = markLimeArr;
                } else if (index === 1) {
                    $(this).addClass('active').siblings().removeClass('active');
                    for (var i = 0; i < arr.length; i++) {
                        if ((parseFloat(arr[i][0]) >= parseFloat(markLimeArr[0].xAxis)) && (parseFloat(arr[i][1]) >= parseFloat(markLimeArr[1].yAxis))) {
                            arrTemp.push(arr[i]);
                        } else {
                            arrTemp.push([0, 0, 0, i])
                        }
                    }
                    currentOptionTemp.series[0].markLine.data = [];
                } else if (index === 2) {
                    $(this).addClass('active').siblings().removeClass('active');
                    for (var i = 0; i < arr.length; i++) {
                        if ((parseFloat(arr[i][0]) < parseFloat(markLimeArr[0].xAxis)) && (parseFloat(arr[i][1]) >= parseFloat(markLimeArr[1].yAxis))) {
                            arrTemp.push(arr[i]);
                        } else {
                            arrTemp.push([0, 0, 0, i])
                        }
                    }
                    currentOptionTemp.series[0].markLine.data = [];
                } else if (index === 3) {
                    $(this).addClass('active').siblings().removeClass('active');
                    for (var i = 0; i < arr.length; i++) {
                        if ((parseFloat(arr[i][0]) < parseFloat(markLimeArr[0].xAxis)) && (parseFloat(arr[i][1]) < parseFloat(markLimeArr[1].yAxis))) {
                            arrTemp.push(arr[i]);
                        } else {
                            arrTemp.push([0, 0, 0, i])
                        }
                    }
                    currentOptionTemp.series[0].markLine.data = [];
                } else if (index === 4) {
                    $(this).addClass('active').siblings().removeClass('active');
                    for (var i = 0; i < arr.length; i++) {
                        if ((parseFloat(arr[i][0]) >= parseFloat(markLimeArr[0].xAxis)) && (parseFloat(arr[i][1]) < parseFloat(markLimeArr[1].yAxis))) {
                            arrTemp.push(arr[i]);
                        } else {
                            arrTemp.push([0, 0, 0, i])
                        }
                    }
                    currentOptionTemp.series[0].markLine.data = [];
                }
                currentOptionTemp.series[0].data = arrTemp;
                $this.chart.clear();
                $this.chart.setOption(currentOptionTemp);
                optionAgelimit.series[0].data = arr;
                optionAgelimit.series[0].markLine.data = markLimeArr;
            });
        },
        optionChart: {
            color: ['#2089ff', '#6c63ff', '#12a0df', '#fb8a22', '#fef534'],
            backgroundColor: '#373945',
            tooltip: {
                trigger: 'axis',
                axisPointer: { // 坐标轴指示器，坐标轴触发有效
                    type: 'shadow' // 默认为直线，可选为：'line' | 'shadow'
                },
                textStyle: {
                    fontSize: 0.28 * rem
                },
                formatter: function (a) {
                    var str = a[0].name + '<br>';
                    for (var i = 0; i < a.length; i++) {
                        str += a[i].seriesName + '：' + ((a[i].seriesId.indexOf('次') !== -1) ? fix0(a[i].data) : (fix2(a[i].data) + '%')) + '<br>'
                    }
                    return str;
                }
            },
            legend: {
                x: "right", top: 0.4 * rem, left: 8 * rem,
                textStyle: {
                    color: '#AAA',
                    fontSize: 0.28 * rem
                },
                data: ['计划保养数', '实际保养数', '保养率', '保养及时率']
            },
            dataZoom: {
                type: 'inside',
                xAxisIndex: [0],
                start: 0,
                end: 100
            },
            grid: {top: 1.6 * rem, left: 0.4 * rem, right: 0.4 * rem, bottom: 0, containLabel: true},
            xAxis: {
                type: 'category',
                data: [],
                axisLabel: {rotate: 30, fontWeight: 100, fontSize: 0.24 * rem, textStyle: {color: '#fff'}},
                nameTextStyle: {color: '#fff', fontSize: 0.28 * rem},
                splitLine: {show: false, lineStyle: {color: '#f00', type: 'dashed'}},
                axisLine: {lineStyle: {color: '#fff'}},
                axisTick: {lineStyle: {color: '#fff'}}
            },
            yAxis: [{
                name: $.i18n.prop('share.unit.shuliang'),
                type: 'value',
                splitLine: {lineStyle: {type: 'dashed'}},
                axisLabel: {fontSize: 0.28 * rem, textStyle: {color: '#fff'}},
                nameTextStyle: {color: '#fff', fontSize: 0.28 * rem},
                axisLine: {lineStyle: {color: '#fff'}},
                axisTick: {lineStyle: {color: '#fff'}}
            }, {
                name: '%',
                type: 'value',
                splitLine: {show: false, lineStyle: {type: 'dashed'}},
                axisLabel: {fontSize: 0.28 * rem, textStyle: {color: '#fff'}},
                nameTextStyle: {color: '#fff', fontSize: 0.28 * rem},
                axisLine: {lineStyle: {color: '#fff'}},
                axisTick: {lineStyle: {color: '#fff'}}
            }, {show: false, name: '%'}],
            series: [{id: '次-1',name: '计划保养数', type: 'bar', barMaxWidth: 0.8 * rem, barGap: '0%', data: [], itemStyle: {normal: {opacity: 0.8}}},
                {id: '次-2',name: '实际保养数', type: 'bar', barMaxWidth: 0.8 * rem, data: [], itemStyle: {normal: {opacity: 0.8}}},
                {name: '保养率', type: 'line', yAxisIndex: 1, data: [], lineStyle: {normal: {width: 2}}},
                {name: '保养率同比', type: 'line', yAxisIndex: 2, data: [], lineStyle: {normal: {opacity: 0}}, itemStyle: {normal: {opacity: 0}}},
                {name: '保养及时率', type: 'line', yAxisIndex: 1, data: [], lineStyle: {normal: {width: 2}}}]
        },
        optionYear: {
            color: ['#2089ff', '#6c63ff', '#12a0df', '#fb8a22', '#fef534'],
            backgroundColor: '#373945',
            tooltip: {
                trigger: 'axis',
                axisPointer: {type: 'shadow'},
                textStyle: {fontSize: 0.28 * rem},
                formatter: function (params) {
                    var str = params[0].name + '：<br>';
                    for (var i = 0; i < params.length; i++) {
                        str += params[i].seriesName + '：' + (params[i].seriesType === 'bar' ? fix0(params[i].data) : fix2(params[i].data) + '%') + '<br>';
                    }
                    return str;
                }
            },
            legend: {
                x: "right", top: 0.4 * rem, left: 8 * rem,
                textStyle: {color: '#AAA', fontSize: 0.28 * rem},
                data: ['计划巡检数', '实际巡检数', '巡检率', '巡检率同比']
            },
            grid: {top: 1.6 * rem, left: rem * 0.4, right: rem, bottom: 0, containLabel: true},
            xAxis: {
                type: 'category', data: [],
                nameTextStyle: {color: '#fff', fontSize: 0.28 * rem},
                axisLabel: {show: true, fontSize: 0.28 * rem, textStyle: {color: '#fff'}},
                splitLine: {show: false, lineStyle: {color: '#f00', type: 'dashed'}},
                axisLine: {lineStyle: {color: '#fff'}},
                axisTick: {lineStyle: {color: '#fff'}}
            },
            yAxis: [{
                name: $.i18n.prop('share.unit.shuliang'), type: 'value',
                nameTextStyle: {color: '#fff', fontSize: 0.28 * rem},
                axisLabel: {show: true, fontSize: 0.28 * rem, textStyle: {color: '#fff'}},
                splitLine: {show: false, lineStyle: {color: '#fff', type: 'dashed'}},
                axisLine: {lineStyle: {color: '#fff'}},
                axisTick: {lineStyle: {color: '#fff'}}
            }, {
                name: '%', type: 'value',
                nameTextStyle: {color: '#fff', fontSize: 0.28 * rem},
                axisLabel: {show: true, fontSize: 0.28 * rem, textStyle: {color: '#fff'}},
                splitLine: {show: false, lineStyle: {color: '#fff', type: 'dashed'}},
                axisLine: {lineStyle: {color: '#fff'}},
                axisTick: {lineStyle: {color: '#fff'}}
            }],
            series: [{name: '计划巡检数', type: 'bar', barGap: '0%', barMaxWidth: 0.8 * rem, data: []},
                {name: '实际巡检数', type: 'bar', yAxisIndex: 0, barMaxWidth: 0.8 * rem, data: []},
                {name: '巡检率', type: 'line', yAxisIndex: 1, data: []},
                {name: '巡检率同比', type: 'line', yAxisIndex: 1, data: []}]
        }
    };
    /* Top5对象 */
    $containerObj.top5Obj = {
        main: $containerObj.main.find('.main-top5'), // top5主对象
        data: {}, // top5数据存储 hospital、type、assets、year
        status: {
            array: {},
            getStatus: function () {
                var arr = $headerObj.page[$headerObj.page.current].query;
                for (var i = 0; i < arr.length; i++) {
                    if (!this.array[arr[i]]) return false;
                }
                return true;
            },
            resetStatus: function () {
                for (var key in this.array) {
                    this.array[key] = false;
                }
            }
        },
        /* top5对象初始化方法 */
        init: function () {

        },
        /* 切换显示 历年数据（传值） or 全部显示 */
        changeShow: function (value) {
            if (value) {
                this.main.find('.top5').hide();
                this.main.find('.top5-year, .top5-assets').show();
            } else {
                this.main.find('.top5-year').hide().siblings('.top5').show();
            }
        },
        /* 转化top5数据 */
        convertData: function (tag, start, end, index, seriesIndex) {
            this.status.array[tag] = true;
            var data = $.extend({}, $containerObj.data);
            if (tag === 'type') data.type = data.type.list[-1].list ? data.type.list[-1] : {list: []};
            this.data[tag] = [];
            var value1Name = this.main.find('.top5-title .top5-value1');
            var value2Name = this.main.find('.top5-title .top5-value2');
            if (tag === 'year') {
                if ($containerObj.maintenanceType === '1') {    // 保养
                    for (var i = start; i < end; i++) {
                        this.data[tag].push([
                            data[tag].list[i].monthName,
                            data[tag].list[i].month,
                            seriesIndex === 3 ? data[tag].list[i].upkeepTimelyPercentage : data[tag].list[i].upkeepPercentage,
                            fix0(data[tag].list[i].upkeepInfoCount) + '/' + fix0(data[tag].list[i].upkeepDateCount),
                            i === index
                        ]);
                    }
                    value1Name.textAndTitle($.i18n.prop('maintenance.top5.sj-jhbys'));
                    value2Name.textAndTitle(seriesIndex === 3 ? $.i18n.prop('maintenance.table.byjsl(%)') : $.i18n.prop('maintenance.table.byl(%)'));
                } else if ($containerObj.maintenanceType === '2') {    // 巡检
                    for (var i = start; i < end; i++) {
                        this.data[tag].push([
                            data[tag].list[i].monthName,
                            data[tag].list[i].month,
                            seriesIndex === 3 ? data[tag].list[i].inspectionTimelyPercentage : data[tag].list[i].inspectionPercentage,
                            fix0(data[tag].list[i].inspectionInfoCount) + '/' + fix0(data[tag].list[i].inspectionDateCount),
                            i === index
                        ]);
                    }
                    value1Name.textAndTitle($.i18n.prop('maintenance.top5.sj-jhxjs'));
                    value2Name.textAndTitle(seriesIndex === 3 ? $.i18n.prop('maintenance.table.xjjsl(%)') : $.i18n.prop('maintenance.table.xjl(%)'));
                } else if ($containerObj.maintenanceType === '3') {    // 强检
                    for (var i = start; i < end; i++) {
                        this.data[tag].push([
                            data[tag].list[i].monthName,
                            data[tag].list[i].month,
                            seriesIndex === 3 ? data[tag].list[i].compulsoryTimelyPercentage : data[tag].list[i].compulsoryPercentage,
                            fix0(data[tag].list[i].compulsoryVerificationCount) + '/' + fix0(data[tag].list[i].compulsoryDateCount),
                            i === index
                        ]);
                    }
                    value1Name.textAndTitle($.i18n.prop('maintenance.top5.sj-jhqjs'));
                    value2Name.textAndTitle(seriesIndex === 3 ? $.i18n.prop('maintenance.table.qjjsl(%)') : $.i18n.prop('maintenance.table.qjl(%)'));
                }
            } else {
                if ($containerObj.maintenanceType === '1') {    // 保养
                    (data[tag].list || []).sortByKey(seriesIndex === 4 ? 'upkeepTimelyPercentage' : 'jnUpkeepPercentage');
                    for (var i = start; i < end; i++) {
                        this.data[tag].push([
                            data[tag].list[i].name,
                            data[tag].list[i].id,
                            seriesIndex === 4 ? data[tag].list[i].upkeepTimelyPercentage : data[tag].list[i].jnUpkeepPercentage,
                            fix0(data[tag].list[i].jnUpkeepInfoCount) + '/' + fix0(data[tag].list[i].jnUpkeepDateCount),
                            i === index
                        ]);
                    }
                    value1Name.textAndTitle($.i18n.prop('maintenance.top5.sj-jhbys'));
                    value2Name.textAndTitle(seriesIndex === 4 ? $.i18n.prop('maintenance.table.byjsl(%)') : $.i18n.prop('maintenance.table.byl(%)'));
                } else if ($containerObj.maintenanceType === '2') {    // 巡检
                    (data[tag].list || []).sortByKey(seriesIndex === 4 ? 'inspectionTimelyPercentage' : 'jnInspectionPercentage');
                    for (var i = start; i < end; i++) {
                        this.data[tag].push([
                            data[tag].list[i].name,
                            data[tag].list[i].id,
                            seriesIndex === 4 ? data[tag].list[i].inspectionTimelyPercentage : data[tag].list[i].jnInspectionPercentage,
                            fix0(data[tag].list[i].jnInspectionInfoCount) + '/' + fix0(data[tag].list[i].jnInspectionDateCount),
                            i === index
                        ]);
                    }
                    value1Name.textAndTitle($.i18n.prop('maintenance.top5.sj-jhxjs'));
                    value2Name.textAndTitle(seriesIndex === 4 ? $.i18n.prop('maintenance.table.xjjsl(%)') : $.i18n.prop('maintenance.table.xjl(%)'));
                } else if ($containerObj.maintenanceType === '3') {    // 强检
                    (data[tag].list || []).sortByKey(seriesIndex === 4 ? 'compulsoryTimelyPercentage' : 'jnCompulsoryPercentage');
                    for (var i = start; i < end; i++) {
                        this.data[tag].push([
                            data[tag].list[i].name,
                            data[tag].list[i].id,
                            seriesIndex === 4 ? data[tag].list[i].compulsoryTimelyPercentage : data[tag].list[i].jnCompulsoryPercentage,
                            fix0(data[tag].list[i].jnCompulsoryVerificationCount) + '/' + fix0(data[tag].list[i].jnCompulsoryDateCount),
                            i === index
                        ]);
                    }
                    value1Name.textAndTitle($.i18n.prop('maintenance.top5.sj-jhqjs'));
                    value2Name.textAndTitle(seriesIndex === 4 ? $.i18n.prop('maintenance.table.qjjsl(%)') : $.i18n.prop('maintenance.table.qjl(%)'));
                }
            }
            this.setData(tag, start + 1);
            if (this.status.getStatus()) {
                loading(true);
                this.status.resetStatus();
            }
        },
        /* 设置top5数据 */
        setData: function (tag, start) {
            var str = '',
                active = '';
            for (var i = 0; i < this.data[tag].length; i++) {
                active = this.data[tag][i][4] ? ' class="active"' : '';
                str += (
                    '<li><a' + active + '>' +
                    '<span onclick="$containerObj.query(\'' + tag + '\',\'' + this.data[tag][i][1] + '\')" ' +
                    'title="' + (start + i) + ' ' + fixStr(this.data[tag][i][0]) + '" class="top5-key underline">' + fixStr(this.data[tag][i][0]) + '</span>' +
                    '<span class="top5-value1">' + fixStr(this.data[tag][i][3]) + '</span>' +
                    '<span class="top5-value2 jqmeter">' + fix2(this.data[tag][i][2]) + '</span>' +
                    '</a></li>'
                );
            }
            this.main.find('.top5-' + tag + ' ul').html(str);
            this.initJQMeter(tag);
        },
        /* 初始化进度条 */
        initJQMeter: function (tag) {
            this.main.find('.top5-' + tag + ' .jqmeter').each(function () {
                $(this).jQMeter({
                    goal: '$1,00',
                    raised: '$' + parseInt($(this).text()),
                    width: '90%',
                    height: '0.24rem'
                });
            });
        }
    };
    /* 模态框对象 */
    $containerObj.modalObj = {
        main: $('#detail-modal'), // 模态框主对象
        assetsMain: $('#assets-modal'), // 设备、新增、报废设备详情， 覆盖 header
        yearMain: $('#year-modal'), // 历年数据模态框
        data: {}, // 模态框数据
        /* 初始化模态框对象 */
        init: function () {
            this.initModal(); // 初始化模态框
            this.bindEvent(); // 绑定事件
        },
        /* 初始化模态框 */
        initModal: function () {
            var $this = this;
            /* 历年数据模态框 */
            this.yearMain.iziModal({
                title: 'title',
                headerColor: '#222431',
                width: '100%',
                radius: 3,
                zindex: 70,
                history: false,
                bodyOverflow: true,
                fullscreen: true,
                overlayColor: 'rgba(0, 0, 0, 0)',
                onOpening: function () {
                    /* 添加导出按钮 */
                    if (!$this.yearMain.find('.iziModal-header').find('.export_excel').length) {
                        $this.yearMain.find('.iziModal-header').append('<a class="iziModal-button export_excel"' +
                            ' href="javascript:void(0);" onclick="exportExcel(\'#year-modal\')" title="' + $.i18n.prop('share.sift.dc') + '"><i class="fa' +
                            ' fa-upload"></i></a>');
                    }
                },
                onOpened: function () {
                    /* 设置模态框高度 */
                    var height = $this.yearMain.height() - $this.yearMain.find('.iziModal-header').outerHeight();
                    $this.yearMain.find('.iziModal-content').height(height);
                }
            });
            /* 主模态框 */
            this.main.iziModal({
                title: 'title',
                headerColor: '#222431',
                width: '100%',
                radius: 3,
                zindex: 80,
                history: false,
                bodyOverflow: true,
                fullscreen: true,
                overlayColor: 'rgba(0, 0, 0, 0)',
                onOpening: function () {
                    /* 添加导出按钮 */
                    if (!$this.main.find('.iziModal-header').find('.export_excel').length) {
                        $this.main.find('.iziModal-header').append('<a class="iziModal-button export_excel" href="javascript:void(0);" onclick="exportExcel(\'#detail-modal\')" title="' + $.i18n.prop('share.sift.dc') + '"><i class="fa fa-upload"></i></a>');
                    }
                },
                onOpened: function () {
                    /* 设置模态框高度 */
                    var height = $this.main.height() - $this.main.find('.iziModal-header').outerHeight();
                    $this.main.find('.iziModal-content').height(height);
                }
            });
            /* 设备、新增、报废模态框 */
            this.assetsMain.iziModal({
                title: $.i18n.prop('share.talbe.sbxq'),
                headerColor: '#222431',
                width: '100%',
                radius: 3,
                zindex: 111,
                history: false,
                bodyOverflow: true,
                fullscreen: true,
                overlayColor: 'rgba(0, 0, 0, 0)',
                onOpening: function () {
                    /* 添加导出按钮 */
                    if (!$this.assetsMain.find('.iziModal-header').find('.export_excel').length) {
                        $this.assetsMain.find('.iziModal-header').append('<a class="iziModal-button export_excel" href="javascript:void(0);" onclick="exportExcel(\'#assets-modal\')" title="' + $.i18n.prop('share.sift.dc') + '"><i class="fa fa-upload"></i></a>');
                    }
                },
                onOpened: function () {
                    /* 设置模态框高度 */
                    var height = $this.assetsMain.height() - $this.assetsMain.find('.iziModal-header').outerHeight();
                    $this.assetsMain.find('.iziModal-content').height(height);
                }
            });
            // 历年数据表格对象
            this.yearTable = this.yearMain.find('#year-table');
            this.yearThead = this.yearTable.find('thead');
            this.yearTbody = this.yearTable.find('tbody');
            this.yearTfoot = this.yearTable.find('tfoot');
            // 主表格对象
            this.table = this.main.find('#detail-table');
            this.thead = this.table.find('thead');
            this.tbody = this.table.find('tbody');
            this.tfoot = this.table.find('tfoot');
            // 设备表格对象
            this.assetsTable = this.assetsMain.find('#assets-table');
            this.assetsThead = this.assetsTable.find('thead');
            this.assetsTbody = this.assetsTable.find('tbody');
            this.assetsTfoot = this.assetsTable.find('tfoot');
        },
        /* 设置模态框数据 */
        setModal: function (tag, key, sorting, param) {
            var $this = this;
            loading(function () {
                var theadStr = '',
                    tbodyStr = '',
                    tfootStr = '',
                    list = ($this.data[tag].list || []).sortByKey(sorting, key);  // 数据列表根据key排序，sorting郑旭或倒序
                // 清空表格内容
                $this.thead.html('');
                $this.tbody.html('');
                $this.tfoot.html('');
                $this.main.data().tag = tag; // 设置tag，用于模态框显示时，筛选刷新模态框数据
                if (tag === 'hospital') {
                    $this.main.iziModal('setTitle', $.i18n.prop('share.table.title.yljgfbxq'));
                    theadStr = (
                        '<tr><th class="tc">#</th>' +
                        '<th class="sort tl" data-key="name">'+$.i18n.prop('index.table.yymc')+'</th>'
                    );
                    tfootStr = (
                        '<tr>' +
                        '<td class="tc">'+$.i18n.prop('share.table.tail.zj')+'</td>' +
                        '<td class="tl">' + list.length + '</td>'
                    );
                    if ($containerObj.maintenanceType === '1') { // 保养
                        theadStr += (
                            '<th class="sort tr" data-key="jnUpkeepDateCount">'+$.i18n.prop('maintenance.overview.jhbys')+'</th>' +
                            '<th class="sort tr" data-key="jnUpkeepInfoCount">'+$.i18n.prop('maintenance.overview.sjbys')+'</th>' +
                            '<th class="sort tr" data-key="jnUpkeepDateAssetsCount">'+$.i18n.prop('share.talbe.jhsbs')+'</th>' +
                            '<th class="sort tr" data-key="jnUpkeepInfoAssetsCount">'+$.i18n.prop('share.talbe.sjsbs')+'</th>' +
                            '<th class="sort tr" data-key="jnUpkeepPercentage">'+$.i18n.prop('maintain.table.byl(%)')+'</th>' +
                            '<th class="sort tr" data-key="tbUpkeepPercentage">'+$.i18n.prop('maintenance.table.byltb(%)')+'</th>' +
                            '<th class="sort tr" data-key="upkeepTimelyPercentage">'+$.i18n.prop('maintenance.table.byjsl(%)')+'</th>' +
                            '</tr>'
                        );
                        tfootStr += (
                            '<td class="tr">' + fix0(list[-1].jnUpkeepDateCount) + '</td>' +
                            '<td class="tr">' + fix0(list[-1].jnUpkeepInfoCount) + '</td>' +
                            '<td class="tr">' + fix0(list[-1].jnUpkeepDateAssetsCount) + '</td>' +
                            '<td class="tr">' + fix0(list[-1].jnUpkeepInfoAssetsCount) + '</td>' +
                            '<td class="tr">' + fix2(list[-1].jnUpkeepPercentage / list.length) + '</td>' +
                            '<td class="tr">' + fix2(list[-1].tbUpkeepPercentage / list.length) + '</td>' +
                            '<td class="tr">' + fix2(list[-1].upkeepTimelyPercentage / list.length) + '</td>' +
                            '</tr>'
                        );
                    } else if ($containerObj.maintenanceType === '2') { // 巡检
                        theadStr += (
                            '<th class="sort tr" data-key="jnInspectionDateCount">'+$.i18n.prop('maintenance.table.jhxjs')+'</th>' +
                            '<th class="sort tr" data-key="jnInspectionInfoCount">'+$.i18n.prop('maintenance.table.sjxjs')+'</th>' +
                            '<th class="sort tr" data-key="jnInspectionDateAssetsCount">'+$.i18n.prop('share.talbe.jhsbs')+'</th>' +
                            '<th class="sort tr" data-key="jnInspectionInfoAssetsCount">'+$.i18n.prop('share.talbe.sjsbs')+'</th>' +
                            '<th class="sort tr" data-key="jnInspectionPercentage">'+$.i18n.prop('maintenance.table.xjl(%)')+'</th>' +
                            '<th class="sort tr" data-key="tbInspectionPercentage">'+$.i18n.prop('maintenance.table.xjltb(%)')+'</th>' +
                            '<th class="sort tr" data-key="inspectionTimelyPercentage">'+$.i18n.prop('maintenance.table.xjjsl(%)')+'</th>' +
                            '</tr>'
                        );
                        tfootStr += (
                            '<td class="tr">' + fix0(list[-1].jnInspectionDateCount) + '</td>' +
                            '<td class="tr">' + fix0(list[-1].jnInspectionInfoCount) + '</td>' +
                            '<td class="tr">' + fix0(list[-1].jnInspectionDateAssetsCount) + '</td>' +
                            '<td class="tr">' + fix0(list[-1].jnInspectionInfoAssetsCount) + '</td>' +
                            '<td class="tr">' + fix2(list[-1].jnInspectionPercentage / list.length) + '</td>' +
                            '<td class="tr">' + fix2(list[-1].tbInspectionPercentage / list.length) + '</td>' +
                            '<td class="tr">' + fix2(list[-1].inspectionTimelyPercentage / list.length) + '</td>' +
                            '</tr>'
                        );
                    } else if ($containerObj.maintenanceType === '3') { // 强检
                        theadStr += (
                            '<th class="sort tr" data-key="jnCompulsoryDateCount">'+$.i18n.prop('maintenance.table.jhqjs')+'</th>' +
                            '<th class="sort tr" data-key="jnCompulsoryVerificationCount">'+$.i18n.prop('maintenance.table.sjqjs')+'</th>' +
                            '<th class="sort tr" data-key="jnCompulsoryDateAssetsCount">'+$.i18n.prop('share.talbe.jhsbs')+'</th>' +
                            '<th class="sort tr" data-key="jnCompulsoryVerificationAssetsCount">'+$.i18n.prop('share.talbe.sjsbs')+'</th>' +
                            '<th class="sort tr" data-key="jnCompulsoryPercentage">'+$.i18n.prop('maintenance.table.qjl(%)')+'</th>' +
                            '<th class="sort tr" data-key="tbCompulsoryPercentage">'+$.i18n.prop('maintenance.table.qjltb(%)')+'</th>' +
                            '<th class="sort tr" data-key="compulsoryTimelyPercentage">'+$.i18n.prop('maintenance.table.qjjsl(%)')+'</th>' +
                            '</tr>'
                        );
                        tfootStr += (
                            '<td class="tr">' + fix0(list[-1].jnCompulsoryDateCount) + '</td>' +
                            '<td class="tr">' + fix0(list[-1].jnCompulsoryVerificationCount) + '</td>' +
                            '<td class="tr">' + fix0(list[-1].jnCompulsoryDateAssetsCount) + '</td>' +
                            '<td class="tr">' + fix0(list[-1].jnCompulsoryVerificationAssetsCount) + '</td>' +
                            '<td class="tr">' + fix2(list[-1].jnCompulsoryPercentage / list.length) + '</td>' +
                            '<td class="tr">' + fix2(list[-1].tbCompulsoryPercentage / list.length) + '</td>' +
                            '<td class="tr">' + fix2(list[-1].compulsoryTimelyPercentage / list.length) + '</td>' +
                            '</tr>'
                        );
                    }
                    for (var i = 0; i < list.length; i++) {
                        tbodyStr += (
                            '<tr>' +
                            '<td class="tc">' + (i + 1) + '</td>' +
                            '<td class="spanTitle" onclick="$containerObj.query(\'' + tag + '\',\'' + list[i].id + '\')">' + fixStr(list[i].name) + '</td>'
                        );
                        if ($containerObj.maintenanceType === '1') { // 保养
                            tbodyStr += (
                                '<td class="tr' + (list[i].jnUpkeepDateCount ? ' spanTitle' : '') +
                                    '" onclick="$containerObj.modalObj.query(\'plan-record\',\'{hospitalId:[' + list[i].id + '],maintenanceType:1}\',\'' + list[i].jnUpkeepDateCount + '\')">' +
                                    fix0(list[i].jnUpkeepDateCount) + '</td>' +
                                '<td class="tr' + (list[i].jnUpkeepInfoCount ? ' spanTitle' : '') +
                                    '" onclick="$containerObj.modalObj.query(\'actual-record\',\'{hospitalId:[' + list[i].id + '],maintenanceType:1}\',\'' + list[i].jnUpkeepInfoCount + '\')">' +
                                    fix0(list[i].jnUpkeepInfoCount) + '</td>' +
                                '<td class="tr' + (list[i].jnUpkeepDateAssetsCount ? ' spanTitle' : '') +
                                    '" onclick="$containerObj.modalObj.query(\'plan-device\',\'{hospitalId:[' + list[i].id + '],maintenanceType:1}\',\'' + list[i].jnUpkeepDateAssetsCount + '\')">' +
                                    fix0(list[i].jnUpkeepDateAssetsCount) + '</td>' +
                                '<td class="tr' + (list[i].jnUpkeepInfoAssetsCount ? ' spanTitle' : '') +
                                    '" onclick="$containerObj.modalObj.query(\'actual-device\',\'{hospitalId:[' + list[i].id + '],maintenanceType:1}\',\'' + list[i].jnUpkeepInfoAssetsCount + '\')">' +
                                    fix0(list[i].jnUpkeepInfoAssetsCount) + '</td>' +
                                '<td class="tr">' + fix2(list[i].jnUpkeepPercentage) + '</td>' +
                                '<td class="tr">' + fix2(list[i].tbUpkeepPercentage) + '</td>' +
                                '<td class="tr">' + fix2(list[i].upkeepTimelyPercentage) + '</td>' +
                                '</tr>'
                            );
                        } else if ($containerObj.maintenanceType === '2') { // 巡检
                            tbodyStr += (
                                '<td class="tr' + (list[i].jnInspectionDateCount ? ' spanTitle' : '') +
                                    '" onclick="$containerObj.modalObj.query(\'plan-record\',\'{hospitalId:[' + list[i].id + '],maintenanceType:2}\',\'' + list[i].jnInspectionDateCount + '\')">' +
                                    fix0(list[i].jnInspectionDateCount) + '</td>' +
                                '<td class="tr' + (list[i].jnInspectionInfoCount ? ' spanTitle' : '') +
                                    '" onclick="$containerObj.modalObj.query(\'actual-record\',\'{hospitalId:[' + list[i].id + '],maintenanceType:2}\',\'' + list[i].jnInspectionInfoCount + '\')">' +
                                    fix0(list[i].jnInspectionInfoCount) + '</td>' +
                                '<td class="tr' + (list[i].jnInspectionDateAssetsCount ? ' spanTitle' : '') +
                                    '" onclick="$containerObj.modalObj.query(\'plan-device\',\'{hospitalId:[' + list[i].id + '],maintenanceType:2}\',\'' + list[i].jnInspectionDateAssetsCount + '\')">' +
                                    fix0(list[i].jnInspectionDateAssetsCount) + '</td>' +
                                '<td class="tr' + (list[i].jnInspectionInfoAssetsCount ? ' spanTitle' : '') +
                                    '" onclick="$containerObj.modalObj.query(\'actual-device\',\'{hospitalId:[' + list[i].id + '],maintenanceType:2}\',\'' + list[i].jnInspectionInfoAssetsCount + '\')">' +
                                    fix0(list[i].jnInspectionInfoAssetsCount) + '</td>' +
                                '<td class="tr">' + fix2(list[i].jnInspectionPercentage) + '</td>' +
                                '<td class="tr">' + fix2(list[i].tbInspectionPercentage) + '</td>' +
                                '<td class="tr">' + fix2(list[i].inspectionTimelyPercentage) + '</td>' +
                                '</tr>'
                            );
                        } else if ($containerObj.maintenanceType === '3') { // 强检
                            tbodyStr += (
                                '<td class="tr' + (list[i].jnCompulsoryDateCount ? ' spanTitle' : '') +
                                    '" onclick="$containerObj.modalObj.query(\'plan-record\',\'{hospitalId:[' + list[i].id + '],maintenanceType:3}\',\'' + list[i].jnCompulsoryDateCount + '\')">' +
                                    fix0(list[i].jnCompulsoryDateCount) + '</td>' +
                                '<td class="tr' + (list[i].jnCompulsoryVerificationCount ? ' spanTitle' : '') +
                                    '" onclick="$containerObj.modalObj.query(\'actual-record\',\'{hospitalId:[' + list[i].id + '],maintenanceType:3}\',\'' + list[i].jnCompulsoryVerificationCount + '\')">' +
                                    fix0(list[i].jnCompulsoryVerificationCount) + '</td>' +
                                '<td class="tr' + (list[i].jnCompulsoryDateAssetsCount ? ' spanTitle' : '') +
                                    '" onclick="$containerObj.modalObj.query(\'plan-device\',\'{hospitalId:[' + list[i].id + '],maintenanceType:3}\',\'' + list[i].jnCompulsoryDateAssetsCount + '\')">' +
                                    fix0(list[i].jnCompulsoryDateAssetsCount) + '</td>' +
                                '<td class="tr' + (list[i].jnCompulsoryVerificationAssetsCount ? ' spanTitle' : '') +
                                    '" onclick="$containerObj.modalObj.query(\'actual-device\',\'{hospitalId:[' + list[i].id + '],maintenanceType:3}\',\'' + list[i].jnCompulsoryVerificationAssetsCount + '\')">' +
                                    fix0(list[i].jnCompulsoryVerificationAssetsCount) + '</td>' +
                                '<td class="tr">' + fix2(list[i].jnCompulsoryPercentage) + '</td>' +
                                '<td class="tr">' + fix2(list[i].tbCompulsoryPercentage) + '</td>' +
                                '<td class="tr">' + fix2(list[i].compulsoryTimelyPercentage) + '</td>' +
                                '</tr>'
                            );
                        }
                    }
                } else if (tag === 'type') {
                    $this.main.iziModal('setTitle', $.i18n.prop('share.table.title.sblxfbxq'));
                    theadStr = (
                        '<tr><th class="tl">'+$.i18n.prop('index.table.yjsb')+'</th>' +
                        '<th class="sort tl" data-key="name">'+$.i18n.prop('share.table.head.sblx')+'</th>'
                    );
                    tfootStr = (
                        '<tr>' +
                        '<td class="tl">'+$.i18n.prop('share.table.tail.zj')+' ' + list.length + '</td>' +
                        '<td class="tl">' + list[-1].list.length + '</td>'
                    );
                    if ($containerObj.maintenanceType === '1') { // 保养
                        theadStr += (
                            '<th class="sort tr" data-key="jnUpkeepDateCount">'+$.i18n.prop('maintenance.overview.jhbys')+'</th>' +
                            '<th class="sort tr" data-key="jnUpkeepInfoCount">'+$.i18n.prop('maintenance.overview.sjbys')+'</th>' +
                            '<th class="sort tr" data-key="jnUpkeepDateAssetsCount">'+$.i18n.prop('share.talbe.jhsbs')+'</th>' +
                            '<th class="sort tr" data-key="jnUpkeepInfoAssetsCount">'+$.i18n.prop('share.talbe.sjsbs')+'</th>' +
                            '<th class="sort tr" data-key="jnUpkeepPercentage">'+$.i18n.prop('maintain.table.byl(%)')+'</th>' +
                            '<th class="sort tr" data-key="tbUpkeepPercentage">'+$.i18n.prop('maintenance.table.byltb(%)')+'</th>' +
                            '<th class="sort tr" data-key="upkeepTimelyPercentage">'+$.i18n.prop('maintenance.table.byjsl(%)')+'</th>' +
                            '</tr>'
                        );
                        tfootStr += (
                            '<td class="tr">' + fix0(list[-1].jnUpkeepDateCount) + '</td>' +
                            '<td class="tr">' + fix0(list[-1].jnUpkeepInfoCount) + '</td>' +
                            '<td class="tr">' + fix0(list[-1].jnUpkeepDateAssetsCount) + '</td>' +
                            '<td class="tr">' + fix0(list[-1].jnUpkeepInfoAssetsCount) + '</td>' +
                            '<td class="tr">' + fix2(list[-1].jnUpkeepPercentage / list[-1].list.length) + '</td>' +
                            '<td class="tr">' + fix2(list[-1].tbUpkeepPercentage / list[-1].list.length) + '</td>' +
                            '<td class="tr">' + fix2(list[-1].upkeepTimelyPercentage / list[-1].list.length) + '</td>' +
                            '</tr>'
                        );
                    } else if ($containerObj.maintenanceType === '2') { // 巡检
                        theadStr += (
                            '<th class="sort tr" data-key="jnInspectionDateCount">'+$.i18n.prop('maintenance.table.jhxjs')+'</th>' +
                            '<th class="sort tr" data-key="jnInspectionInfoCount">'+$.i18n.prop('maintenance.table.sjxjs')+'</th>' +
                            '<th class="sort tr" data-key="jnInspectionDateAssetsCount">'+$.i18n.prop('share.talbe.jhsbs')+'</th>' +
                            '<th class="sort tr" data-key="jnInspectionInfoAssetsCount">'+$.i18n.prop('share.talbe.sjsbs')+'</th>' +
                            '<th class="sort tr" data-key="jnInspectionPercentage">'+$.i18n.prop('maintenance.table.xjl(%)')+'</th>' +
                            '<th class="sort tr" data-key="tbInspectionPercentage">'+$.i18n.prop('maintenance.table.xjltb(%)')+'</th>' +
                            '<th class="sort tr" data-key="inspectionTimelyPercentage">'+$.i18n.prop('maintenance.table.xjjsl(%)')+'</th>' +
                            '</tr>'
                        );
                        tfootStr += (
                            '<td class="tr">' + fix0(list[-1].jnInspectionDateCount) + '</td>' +
                            '<td class="tr">' + fix0(list[-1].jnInspectionInfoCount) + '</td>' +
                            '<td class="tr">' + fix0(list[-1].jnInspectionDateAssetsCount) + '</td>' +
                            '<td class="tr">' + fix0(list[-1].jnInspectionInfoAssetsCount) + '</td>' +
                            '<td class="tr">' + fix2(list[-1].jnInspectionPercentage / list[-1].list.length) + '</td>' +
                            '<td class="tr">' + fix2(list[-1].tbInspectionPercentage / list[-1].list.length) + '</td>' +
                            '<td class="tr">' + fix2(list[-1].inspectionTimelyPercentage / list[-1].list.length) + '</td>' +
                            '</tr>'
                        );
                    } else if ($containerObj.maintenanceType === '3') { // 强检
                        theadStr += (
                            '<th class="sort tr" data-key="jnCompulsoryDateCount">'+$.i18n.prop('maintenance.table.jhqjs')+'</th>' +
                            '<th class="sort tr" data-key="jnCompulsoryVerificationCount">'+$.i18n.prop('maintenance.table.sjqjs')+'</th>' +
                            '<th class="sort tr" data-key="jnCompulsoryDateAssetsCount">'+$.i18n.prop('share.talbe.jhsbs')+'</th>' +
                            '<th class="sort tr" data-key="jnCompulsoryVerificationAssetsCount">'+$.i18n.prop('share.talbe.sjsbs')+'</th>' +
                            '<th class="sort tr" data-key="jnCompulsoryPercentage">'+$.i18n.prop('maintenance.table.qjl(%)')+'</th>' +
                            '<th class="sort tr" data-key="tbCompulsoryPercentage">'+$.i18n.prop('maintenance.table.qjltb(%)')+'</th>' +
                            '<th class="sort tr" data-key="compulsoryTimelyPercentage">'+$.i18n.prop('maintenance.table.qjjsl(%)')+'</th>' +
                            '</tr>'
                        );
                        tfootStr += (
                            '<td class="tr">' + fix0(list[-1].jnCompulsoryDateCount) + '</td>' +
                            '<td class="tr">' + fix0(list[-1].jnCompulsoryVerificationCount) + '</td>' +
                            '<td class="tr">' + fix0(list[-1].jnCompulsoryDateAssetsCount) + '</td>' +
                            '<td class="tr">' + fix0(list[-1].jnCompulsoryVerificationAssetsCount) + '</td>' +
                            '<td class="tr">' + fix2(list[-1].jnCompulsoryPercentage / list[-1].list.length) + '</td>' +
                            '<td class="tr">' + fix2(list[-1].tbCompulsoryPercentage / list[-1].list.length) + '</td>' +
                            '<td class="tr">' + fix2(list[-1].compulsoryTimelyPercentage / list[-1].list.length) + '</td>' +
                            '</tr>'
                        );
                    }
                    for (var i = 0; i < list.length; i++) {
                        tbodyStr += (
                            '<tr>' +
                            '<td class="tc border-bottom" rowspan="' + (list[i].list.length + 1) + '">' + fixStr(list[i].name) + '</td>' +
                            '<td class="tl">'+$.i18n.prop('share.table.tail.xj')+'</td>'
                        );
                        if ($containerObj.maintenanceType === '1') { // 保养
                            tbodyStr += (
                                '<td class="tr' + (list[i].jnUpkeepDateCount ? ' spanTitle' : '') +
                                    '" onclick="$containerObj.modalObj.query(\'plan-record\',\'{typeId:[' + list[i].id + ']'+(param||'')+',maintenanceType:1}\',\'' + list[i].jnUpkeepDateCount + '\')">' +
                                    fix0(list[i].jnUpkeepDateCount) + '</td>' +
                                '<td class="tr' + (list[i].jnUpkeepInfoCount ? ' spanTitle' : '') +
                                    '" onclick="$containerObj.modalObj.query(\'actual-record\',\'{typeId:[' + list[i].id + ']'+(param||'')+',maintenanceType:1}\',\'' + list[i].jnUpkeepInfoCount + '\')">' +
                                    fix0(list[i].jnUpkeepInfoCount) + '</td>' +
                                '<td class="tr' + (list[i].jnUpkeepDateAssetsCount ? ' spanTitle' : '') +
                                    '" onclick="$containerObj.modalObj.query(\'plan-device\',\'{typeId:[' + list[i].id + ']'+(param||'')+',maintenanceType:1}\',\'' + list[i].jnUpkeepDateAssetsCount + '\')">' +
                                    fix0(list[i].jnUpkeepDateAssetsCount) + '</td>' +
                                '<td class="tr' + (list[i].jnUpkeepInfoAssetsCount ? ' spanTitle' : '') +
                                    '" onclick="$containerObj.modalObj.query(\'actual-device\',\'{typeId:[' + list[i].id + ']'+(param||'')+',maintenanceType:1}\',\'' + list[i].jnUpkeepInfoAssetsCount + '\')">' +
                                    fix0(list[i].jnUpkeepInfoAssetsCount) + '</td>' +
                                '<td class="tr">' + fix2(list[i].jnUpkeepPercentage) + '</td>' +
                                '<td class="tr">' + fix2(list[i].tbUpkeepPercentage) + '</td>' +
                                '<td class="tr">' + fix2(list[i].upkeepTimelyPercentage) + '</td>' +
                                '</tr>'
                            );
                        } else if ($containerObj.maintenanceType === '2') { // 巡检
                            tbodyStr += (
                                '<td class="tr' + (list[i].jnInspectionDateCount ? ' spanTitle' : '') +
                                    '" onclick="$containerObj.modalObj.query(\'plan-record\',\'{typeId:[' + list[i].id + ']'+(param||'')+',maintenanceType:2}\',\'' + list[i].jnInspectionDateCount + '\')">' +
                                    fix0(list[i].jnInspectionDateCount) + '</td>' +
                                '<td class="tr' + (list[i].jnInspectionInfoCount ? ' spanTitle' : '') +
                                    '" onclick="$containerObj.modalObj.query(\'actual-record\',\'{typeId:[' + list[i].id + ']'+(param||'')+',maintenanceType:2}\',\'' + list[i].jnInspectionInfoCount + '\')">' +
                                    fix0(list[i].jnInspectionInfoCount) + '</td>' +
                                '<td class="tr' + (list[i].jnInspectionDateAssetsCount ? ' spanTitle' : '') +
                                    '" onclick="$containerObj.modalObj.query(\'plan-device\',\'{typeId:[' + list[i].id + ']'+(param||'')+',maintenanceType:2}\',\'' + list[i].jnInspectionDateAssetsCount + '\')">' +
                                    fix0(list[i].jnInspectionDateAssetsCount) + '</td>' +
                                '<td class="tr' + (list[i].jnInspectionInfoAssetsCount ? ' spanTitle' : '') +
                                    '" onclick="$containerObj.modalObj.query(\'actual-device\',\'{typeId:[' + list[i].id + ']'+(param||'')+',maintenanceType:2}\',\'' + list[i].jnInspectionInfoAssetsCount + '\')">' +
                                    fix0(list[i].jnInspectionInfoAssetsCount) + '</td>' +
                                '<td class="tr">' + fix2(list[i].jnInspectionPercentage) + '</td>' +
                                '<td class="tr">' + fix2(list[i].tbInspectionPercentage) + '</td>' +
                                '<td class="tr">' + fix2(list[i].inspectionTimelyPercentage) + '</td>' +
                                '</tr>'
                            );
                        } else if ($containerObj.maintenanceType === '3') { // 强检
                            tbodyStr += (
                                '<td class="tr' + (list[i].jnCompulsoryDateCount ? ' spanTitle' : '') +
                                    '" onclick="$containerObj.modalObj.query(\'plan-record\',\'{typeId:[' + list[i].id + ']'+(param||'')+',maintenanceType:3}\',\'' + list[i].jnCompulsoryDateCount + '\')">' +
                                    fix0(list[i].jnCompulsoryDateCount) + '</td>' +
                                '<td class="tr' + (list[i].jnCompulsoryVerificationCount ? ' spanTitle' : '') +
                                    '" onclick="$containerObj.modalObj.query(\'actual-record\',\'{typeId:[' + list[i].id + ']'+(param||'')+',maintenanceType:3}\',\'' + list[i].jnCompulsoryVerificationCount + '\')">' +
                                    fix0(list[i].jnCompulsoryVerificationCount) + '</td>' +
                                '<td class="tr' + (list[i].jnCompulsoryDateAssetsCount ? ' spanTitle' : '') +
                                    '" onclick="$containerObj.modalObj.query(\'plan-device\',\'{typeId:[' + list[i].id + ']'+(param||'')+',maintenanceType:3}\',\'' + list[i].jnCompulsoryDateAssetsCount + '\')">' +
                                    fix0(list[i].jnCompulsoryDateAssetsCount) + '</td>' +
                                '<td class="tr' + (list[i].jnCompulsoryVerificationAssetsCount ? ' spanTitle' : '') +
                                    '" onclick="$containerObj.modalObj.query(\'actual-device\',\'{typeId:[' + list[i].id + ']'+(param||'')+',maintenanceType:3}\',\'' + list[i].jnCompulsoryVerificationAssetsCount + '\')">' +
                                    fix0(list[i].jnCompulsoryVerificationAssetsCount) + '</td>' +
                                '<td class="tr">' + fix2(list[i].jnCompulsoryPercentage) + '</td>' +
                                '<td class="tr">' + fix2(list[i].tbCompulsoryPercentage) + '</td>' +
                                '<td class="tr">' + fix2(list[i].compulsoryTimelyPercentage) + '</td>' +
                                '</tr>'
                            );
                        }
                        var selist = list[i].list;
                        for (var k = 0; k < selist.length; k++) {
                            tbodyStr += (
                                '<tr' + (k === selist.length - 1 ? ' class="border-bottom"' : '') + '>' +
                                '<td class="spanTitle" onclick="$containerObj.query(\'' + tag + '\',\'' + selist[k].id + '\')">' + fixStr(selist[k].name) + '</td>'
                            );
                            if ($containerObj.maintenanceType === '1') { // 保养
                                tbodyStr += (
                                    '<td class="tr' + (selist[k].jnUpkeepDateCount ? ' spanTitle' : '') +
                                    '" onclick="$containerObj.modalObj.query(\'plan-record\',\'{typeId:[' + selist[k].id + ']'+(param||'')+',maintenanceType:1}\',\'' + selist[k].jnUpkeepDateCount + '\')">' +
                                    fix0(selist[k].jnUpkeepDateCount) + '</td>' +
                                    '<td class="tr' + (selist[k].jnUpkeepInfoCount ? ' spanTitle' : '') +
                                    '" onclick="$containerObj.modalObj.query(\'actual-record\',\'{typeId:[' + selist[k].id + ']'+(param||'')+',maintenanceType:1}\',\'' + selist[k].jnUpkeepInfoCount + '\')">' +
                                    fix0(selist[k].jnUpkeepInfoCount) + '</td>' +
                                    '<td class="tr' + (selist[k].jnUpkeepDateAssetsCount ? ' spanTitle' : '') +
                                    '" onclick="$containerObj.modalObj.query(\'plan-device\',\'{typeId:[' + selist[k].id + ']'+(param||'')+',maintenanceType:1}\',\'' + selist[k].jnUpkeepDateAssetsCount + '\')">' +
                                    fix0(selist[k].jnUpkeepDateAssetsCount) + '</td>' +
                                    '<td class="tr' + (selist[k].jnUpkeepInfoAssetsCount ? ' spanTitle' : '') +
                                    '" onclick="$containerObj.modalObj.query(\'actual-device\',\'{typeId:[' + selist[k].id + ']'+(param||'')+',maintenanceType:1}\',\'' + selist[k].jnUpkeepInfoAssetsCount + '\')">' +
                                    fix0(selist[k].jnUpkeepInfoAssetsCount) + '</td>' +
                                    '<td class="tr">' + fix2(selist[k].jnUpkeepPercentage) + '</td>' +
                                    '<td class="tr">' + fix2(selist[k].tbUpkeepPercentage) + '</td>' +
                                    '<td class="tr">' + fix2(selist[k].upkeepTimelyPercentage) + '</td>' +
                                    '</tr>'
                                );
                            } else if ($containerObj.maintenanceType === '2') { // 巡检
                                tbodyStr += (
                                    '<td class="tr' + (selist[k].jnInspectionDateCount ? ' spanTitle' : '') +
                                    '" onclick="$containerObj.modalObj.query(\'plan-record\',\'{typeId:[' + selist[k].id + ']'+(param||'')+',maintenanceType:2}\',\'' + selist[k].jnInspectionDateCount + '\')">' +
                                    fix0(selist[k].jnInspectionDateCount) + '</td>' +
                                    '<td class="tr' + (selist[k].jnInspectionInfoCount ? ' spanTitle' : '') +
                                    '" onclick="$containerObj.modalObj.query(\'actual-record\',\'{typeId:[' + selist[k].id + ']'+(param||'')+',maintenanceType:2}\',\'' + selist[k].jnInspectionInfoCount + '\')">' +
                                    fix0(selist[k].jnInspectionInfoCount) + '</td>' +
                                    '<td class="tr' + (selist[k].jnInspectionDateAssetsCount ? ' spanTitle' : '') +
                                    '" onclick="$containerObj.modalObj.query(\'plan-device\',\'{typeId:[' + selist[k].id + ']'+(param||'')+',maintenanceType:2}\',\'' + selist[k].jnInspectionDateAssetsCount + '\')">' +
                                    fix0(selist[k].jnInspectionDateAssetsCount) + '</td>' +
                                    '<td class="tr' + (selist[k].jnInspectionInfoAssetsCount ? ' spanTitle' : '') +
                                    '" onclick="$containerObj.modalObj.query(\'actual-device\',\'{typeId:[' + selist[k].id + ']'+(param||'')+',maintenanceType:2}\',\'' + selist[k].jnInspectionInfoAssetsCount + '\')">' +
                                    fix0(selist[k].jnInspectionInfoAssetsCount) + '</td>' +
                                    '<td class="tr">' + fix2(selist[k].jnInspectionPercentage) + '</td>' +
                                    '<td class="tr">' + fix2(selist[k].tbInspectionPercentage) + '</td>' +
                                    '<td class="tr">' + fix2(selist[k].inspectionTimelyPercentage) + '</td>' +
                                    '</tr>'
                                );
                            } else if ($containerObj.maintenanceType === '3') { // 强检
                                tbodyStr += (
                                    '<td class="tr' + (selist[k].jnCompulsoryDateCount ? ' spanTitle' : '') +
                                    '" onclick="$containerObj.modalObj.query(\'plan-record\',\'{typeId:[' + selist[k].id + ']'+(param||'')+',maintenanceType:3}\',\'' + selist[k].jnCompulsoryDateCount + '\')">' +
                                    fix0(selist[k].jnCompulsoryDateCount) + '</td>' +
                                    '<td class="tr' + (selist[k].jnCompulsoryVerificationCount ? ' spanTitle' : '') +
                                    '" onclick="$containerObj.modalObj.query(\'actual-record\',\'{typeId:[' + selist[k].id + ']'+(param||'')+',maintenanceType:3}\',\'' + selist[k].jnCompulsoryVerificationCount + '\')">' +
                                    fix0(selist[k].jnCompulsoryVerificationCount) + '</td>' +
                                    '<td class="tr' + (selist[k].jnCompulsoryDateAssetsCount ? ' spanTitle' : '') +
                                    '" onclick="$containerObj.modalObj.query(\'plan-device\',\'{typeId:[' + selist[k].id + ']'+(param||'')+',maintenanceType:3}\',\'' + selist[k].jnCompulsoryDateAssetsCount + '\')">' +
                                    fix0(selist[k].jnCompulsoryDateAssetsCount) + '</td>' +
                                    '<td class="tr' + (selist[k].jnCompulsoryVerificationAssetsCount ? ' spanTitle' : '') +
                                    '" onclick="$containerObj.modalObj.query(\'actual-device\',\'{typeId:[' + selist[k].id + ']'+(param||'')+',maintenanceType:3}\',\'' + selist[k].jnCompulsoryVerificationAssetsCount + '\')">' +
                                    fix0(selist[k].jnCompulsoryVerificationAssetsCount) + '</td>' +
                                    '<td class="tr">' + fix2(selist[k].jnCompulsoryPercentage) + '</td>' +
                                    '<td class="tr">' + fix2(selist[k].tbCompulsoryPercentage) + '</td>' +
                                    '<td class="tr">' + fix2(selist[k].compulsoryTimelyPercentage) + '</td>' +
                                    '</tr>'
                                );
                            }
                        }
                    }
                } else if (tag === 'assets') {
                    $this.main.iziModal('setTitle', $.i18n.prop('share.table.title.sbfbxq'));
                    theadStr = (
                        '<tr><th class="tc">#</th>' +
                        '<th class="sort tl" data-key="name">'+$.i18n.prop('share.assets.sbmc')+'</th>' +
                        '<th class="sort tl" data-key="modalName">'+$.i18n.prop('share.assets.sbxh')+'</th>' +
                        '<th class="sort tl" data-key="firstTypeName">'+$.i18n.prop('share.table.head.sblx')+'</th>' +
                        '<th class="sort tl" data-key="hospital">'+$.i18n.prop('share.assets.ssyy')+'</th>' +
                        '<th class="sort tl" data-key="department">'+$.i18n.prop('share.assets.ssks')+'</th>' +
                        '<th class="sort tl" data-key="manufacturer">'+$.i18n.prop('share.table.head.sbcj')+'</th>' +
                        '<th class="sort tl" data-key="sn">'+$.i18n.prop('share.assets.snbh')+'</th>' +
                        '<th class="sort tl" data-key="assetsNo">'+$.i18n.prop('share.assets.zcbh')+'</th>'
                    );
                    tfootStr = (
                        '<tr>' +
                        '<td class="tc">'+$.i18n.prop('share.table.tail.zj')+'</td>' +
                        '<td class="tl">' + list.length + '</td>' +
                        '<td class="tl"></td>' +
                        '<td class="tl"></td>' +
                        '<td class="tl"></td>' +
                        '<td class="tl"></td>' +
                        '<td class="tl"></td>' +
                        '<td class="tl"></td>' +
                        '<td class="tl"></td>' +
                        '<td class="tl"></td>'
                    );
                    if ($containerObj.maintenanceType === '1') { // 保养
                        theadStr += (
                            '<th class="sort tl" data-key="inspectionCycle">'+$.i18n.prop('maintenance.assets.byzq')+'</th>' +
                            '<th class="sort tr" data-key="jnUpkeepDateCount">'+$.i18n.prop('maintenance.table.jhbys')+'</th>' +
                            '<th class="sort tr" data-key="jnUpkeepInfoCount">'+$.i18n.prop('maintenance.table.sjbys')+'</th>' +
                            '<th class="sort tr" data-key="jnUpkeepPercentage">'+$.i18n.prop('maintenance.table.byl(%)')+'</th>' +
                            '<th class="sort tr" data-key="tbUpkeepPercentage">'+$.i18n.prop('maintenance.table.byltb(%)')+'</th>' +
                            '<th class="sort tr" data-key="upkeepTimelyPercentage">'+$.i18n.prop('maintenance.table.byjsl(%)')+'</th>' +
                            '</tr>'
                        );
                        tfootStr += (
                            '<td class="tr">' + fix0(list[-1].jnUpkeepDateCount) + '</td>' +
                            '<td class="tr">' + fix0(list[-1].jnUpkeepInfoCount) + '</td>' +
                            '<td class="tr">' + fix2(list[-1].jnUpkeepPercentage / list.length) + '</td>' +
                            '<td class="tr">' + fix2(list[-1].tbUpkeepPercentage / list.length) + '</td>' +
                            '<td class="tr">' + fix2(list[-1].upkeepTimelyPercentage / list.length) + '</td>' +
                            '</tr>'
                        );
                    } else if ($containerObj.maintenanceType === '2') { // 巡检
                        theadStr += (
                            '<th class="sort tl" data-tag="' + tag + '" data-key="inspectionCycle">'+$.i18n.prop('maintenance.assets.xjzq')+'</th>' +
                            '<th class="sort tr" data-tag="' + tag + '" data-key="jnInspectionDateCount">'+$.i18n.prop('maintenance.table.jhxjs')+'</th>' +
                            '<th class="sort tr" data-tag="' + tag + '" data-key="jnInspectionInfoCount">'+$.i18n.prop('maintenance.table.sjxjs')+'</th>' +
                            '<th class="sort tr" data-tag="' + tag + '" data-key="jnInspectionPercentage">'+$.i18n.prop('maintenance.table.xjl(%)')+'</th>' +
                            '<th class="sort tr" data-tag="' + tag + '" data-key="tbInspectionPercentage">'+$.i18n.prop('maintenance.table.xjltb(%)')+'</th>' +
                            '<th class="sort tr" data-tag="' + tag + '" data-key="inspectionTimelyPercentage">'+$.i18n.prop('maintenance.table.xjjsl(%)')+'</th>' +
                            '</tr>'
                        );
                        tfootStr += (
                            '<td class="tr">' + fix0(list[-1].jnInspectionDateCount) + '</td>' +
                            '<td class="tr">' + fix0(list[-1].jnInspectionInfoCount) + '</td>' +
                            '<td class="tr">' + fix2(list[-1].jnInspectionPercentage / list.length) + '</td>' +
                            '<td class="tr">' + fix2(list[-1].tbInspectionPercentage / list.length) + '</td>' +
                            '<td class="tr">' + fix2(list[-1].inspectionTimelyPercentage / list.length) + '</td>' +
                            '</tr>'
                        );
                    } else if ($containerObj.maintenanceType === '3') { // 强检
                        theadStr += (
                            '<th class="sort tl" data-tag="' + tag + '" data-key="inspectionCycle">'+$.i18n.prop('maintenance.assets.qjzq')+'</th>' +
                            '<th class="sort tr" data-tag="' + tag + '" data-key="jnCompulsoryDateCount">'+$.i18n.prop('maintenance.table.jhqjs')+'</th>' +
                            '<th class="sort tr" data-tag="' + tag + '" data-key="jnCompulsoryVerificationCount">'+$.i18n.prop('maintenance.table.sjqjs')+'</th>' +
                            '<th class="sort tr" data-tag="' + tag + '" data-key="jnCompulsoryPercentage">'+$.i18n.prop('maintenance.table.qjl(%)')+'</th>' +
                            '<th class="sort tr" data-tag="' + tag + '" data-key="tbCompulsoryPercentage">'+$.i18n.prop('maintenance.table.qjltb(%)')+'</th>' +
                            '<th class="sort tr" data-tag="' + tag + '" data-key="compulsoryTimelyPercentage">'+$.i18n.prop('maintenance.table.qjjsl(%)')+'</th>' +
                            '</tr>'
                        );
                        tfootStr += (
                            '<td class="tr">' + fix0(list[-1].jnCompulsoryDateCount) + '</td>' +
                            '<td class="tr">' + fix0(list[-1].jnCompulsoryVerificationCount) + '</td>' +
                            '<td class="tr">' + fix2(list[-1].jnCompulsoryPercentage / list.length) + '</td>' +
                            '<td class="tr">' + fix2(list[-1].tbCompulsoryPercentage / list.length) + '</td>' +
                            '<td class="tr">' + fix2(list[-1].compulsoryTimelyPercentage / list.length) + '</td>' +
                            '</tr>'
                        );
                    }
                    for (var i = 0; i < list.length; i++) {
                        tbodyStr += (
                            '<tr>' +
                            '<td class="tc">' + (i + 1) + '</td>' +
                            '<td class="spanTitle" onclick="$containerObj.query(\'' + tag + '\',\'' + list[i].id + '\')">' + fixStr(list[i].name) + '</td>' +
                            '<td class="tl">' + fixStr(list[i].modalName) + '</td>' +
                            '<td class="tl">' + fixStr(list[i].firstTypeName) + '</td>' +
                            '<td class="tl">' + fixStr(list[i].hospital) + '</td>' +
                            '<td class="tl">' + fixStr(list[i].department) + '</td>' +
                            '<td class="tl">' + fixStr(list[i].manufacturer) + '</td>' +
                            '<td class="tl">' + fixStr(list[i].sn) + '</td>' +
                            '<td class="tl">' + fixStr(list[i].assetsNo) + '</td>'
                        );
                        if ($containerObj.maintenanceType === '1') { // 保养
                            tbodyStr += (
                                '<td class="tl">' + fixStr(list[i].upkeepCycle) + '</td>' +
                                '<td class="tr">' + fix0(list[i].jnUpkeepDateCount) + '</td>' +
                                '<td class="tr">' + fix0(list[i].jnUpkeepInfoCount) + '</td>' +
                                '<td class="tr">' + fix2(list[i].jnUpkeepPercentage) + '</td>' +
                                '<td class="tr">' + fix2(list[i].tbUpkeepPercentage) + '</td>' +
                                '<td class="tr">' + fix2(list[i].upkeepTimelyPercentage) + '</td>' +
                                '</tr>'
                            );
                        } else if ($containerObj.maintenanceType === '2') { // 巡检
                            tbodyStr += (
                                '<td class="tl">' + fixStr(list[i].inspectionCycle) + '</td>' +
                                '<td class="tr">' + fix0(list[i].jnInspectionDateCount) + '</td>' +
                                '<td class="tr">' + fix0(list[i].jnInspectionInfoCount) + '</td>' +
                                '<td class="tr">' + fix2(list[i].jnInspectionPercentage) + '</td>' +
                                '<td class="tr">' + fix2(list[i].tbInspectionPercentage) + '</td>' +
                                '<td class="tr">' + fix2(list[i].inspectionTimelyPercentage) + '</td>' +
                                '</tr>'
                            );
                        } else if ($containerObj.maintenanceType === '3') { // 强检
                            tbodyStr += (
                                '<td class="tl">' + fixStr(list[i].verificationCycle) + '</td>' +
                                '<td class="tr">' + fix0(list[i].jnCompulsoryDateCount) + '</td>' +
                                '<td class="tr">' + fix0(list[i].jnCompulsoryVerificationCount) + '</td>' +
                                '<td class="tr">' + fix2(list[i].jnCompulsoryPercentage) + '</td>' +
                                '<td class="tr">' + fix2(list[i].tbCompulsoryPercentage) + '</td>' +
                                '<td class="tr">' + fix2(list[i].compulsoryTimelyPercentage) + '</td>' +
                                '</tr>'
                            );
                        }
                    }
                } else if (tag === 'year') {
                    $this.yearMain.iziModal('setTitle', $.i18n.prop('charts.button.yfxs'));
                    theadStr = (
                        '<tr><th class="tc">#</th>' +
                        '<th class="sort tl" data-tag="year" data-key="month">'+$.i18n.prop('share.table.head.yf')+'</th>'
                    );
                    tfootStr = (
                        '<tr>' +
                        '<td class="tc">'+$.i18n.prop('share.table.tail.zj')+'</td>' +
                        '<td class="tl">' + list.length + '</td>'
                    );
                    if ($containerObj.maintenanceType === '1') { // 保养
                        theadStr += (
                            '<th class="sort tr" data-key="upkeepDateCount">'+$.i18n.prop('maintenance.overview.jhbys')+'</th>' +
                            '<th class="sort tr" data-key="upkeepInfoCount">'+$.i18n.prop('maintenance.overview.sjbys')+'</th>' +
                            '<th class="sort tr" data-key="upkeepDateAssetsCount">'+$.i18n.prop('share.talbe.jhsbs')+'</th>' +
                            '<th class="sort tr" data-key="upkeepInfoAssetsCount">'+$.i18n.prop('share.talbe.sjsbs')+'</th>' +
                            '<th class="sort tr" data-key="upkeepPercentage">'+$.i18n.prop('maintain.table.byl(%)')+'</th>' +
                            '<th class="sort tr" data-key="upkeepTimelyPercentage">'+$.i18n.prop('maintenance.table.byjsl(%)')+'</th>' +
                            '</tr>'
                        );
                        tfootStr += (
                            '<td class="tr">' + fix0(list[-1].upkeepDateCount) + '</td>' +
                            '<td class="tr">' + fix0(list[-1].upkeepInfoCount) + '</td>' +
                            '<td class="tr">' + fix0(list[-1].upkeepDateAssetsCount) + '</td>' +
                            '<td class="tr">' + fix0(list[-1].upkeepInfoAssetsCount) + '</td>' +
                            '<td class="tr">' + fix2(list[-1].upkeepPercentage / list.length) + '</td>' +
                            '<td class="tr">' + fix2(list[-1].upkeepTimelyPercentage / list.length) + '</td>' +
                            '</tr>'
                        );
                    } else if ($containerObj.maintenanceType === '2') { // 巡检
                        theadStr += (
                            '<th class="sort tr" data-key="inspectionDateCount">'+$.i18n.prop('maintenance.table.jhxjs')+'</th>' +
                            '<th class="sort tr" data-key="inspectionInfoCount">'+$.i18n.prop('maintenance.table.sjxjs')+'</th>' +
                            '<th class="sort tr" data-key="inspectionDateAssetsCount">'+$.i18n.prop('share.talbe.jhsbs')+'</th>' +
                            '<th class="sort tr" data-key="inspectionInfoAssetsCount">'+$.i18n.prop('share.talbe.sjsbs')+'</th>' +
                            '<th class="sort tr" data-key="inspectionPercentage">'+$.i18n.prop('maintenance.table.xjl(%)')+'</th>' +
                            '<th class="sort tr" data-key="inspectionTimelyPercentage">'+$.i18n.prop('maintenance.table.xjjsl(%)')+'</th>' +
                            '</tr>'
                        );
                        tfootStr += (
                            '<td class="tr">' + fix0(list[-1].inspectionDateCount) + '</td>' +
                            '<td class="tr">' + fix0(list[-1].inspectionInfoCount) + '</td>' +
                            '<td class="tr">' + fix0(list[-1].inspectionDateAssetsCount) + '</td>' +
                            '<td class="tr">' + fix0(list[-1].inspectionInfoAssetsCount) + '</td>' +
                            '<td class="tr">' + fix2(list[-1].inspectionPercentage / list.length) + '</td>' +
                            '<td class="tr">' + fix2(list[-1].inspectionTimelyPercentage / list.length) + '</td>' +
                            '</tr>'
                        );
                    } else if ($containerObj.maintenanceType === '3') { // 强检
                        theadStr += (
                            '<th class="sort tr" data-key="compulsoryDateCount">'+$.i18n.prop('maintenance.table.jhqjs')+'</th>' +
                            '<th class="sort tr" data-key="compulsoryVerificationCount">'+$.i18n.prop('maintenance.table.sjqjs')+'</th>' +
                            '<th class="sort tr" data-key="compulsoryDateAssetsCount">'+$.i18n.prop('share.talbe.jhsbs')+'</th>' +
                            '<th class="sort tr" data-key="compulsoryVerificationAssetsCount">'+$.i18n.prop('share.talbe.sjsbs')+'</th>' +
                            '<th class="sort tr" data-key="compulsoryPercentage">'+$.i18n.prop('maintenance.table.qjl(%)')+'</th>' +
                            '<th class="sort tr" data-key="compulsoryTimelyPercentage">'+$.i18n.prop('maintenance.table.qjjsl(%)')+'</th>' +
                            '</tr>'
                        );
                        tfootStr += (
                            '<td class="tr">' + fix0(list[-1].compulsoryDateCount) + '</td>' +
                            '<td class="tr">' + fix0(list[-1].compulsoryVerificationCount) + '</td>' +
                            '<td class="tr">' + fix0(list[-1].compulsoryDateAssetsCount) + '</td>' +
                            '<td class="tr">' + fix0(list[-1].compulsoryVerificationAssetsCount) + '</td>' +
                            '<td class="tr">' + fix2(list[-1].compulsoryPercentage / list.length) + '</td>' +
                            '<td class="tr">' + fix2(list[-1].compulsoryTimelyPercentage / list.length) + '</td>' +
                            '</tr>'
                        );
                    }
                    for (var i = 0; i < list.length; i++) {
                        tbodyStr += (
                            '<tr>' +
                            '<td class="tc">' + (i + 1) + '</td>' +
                            '<td class="spanTitle" onclick="$containerObj.query(\'' + tag + '\',\'' + list[i].month + '\')">' + fixStr(list[i].monthName) + '</td>'
                        );
                        if ($containerObj.maintenanceType === '1') { // 保养
                            tbodyStr += (
                                '<td class="tr' + (list[i].upkeepDateCount ? ' spanTitle' : '') +
                                '" onclick="$containerObj.modalObj.query(\'plan-record\',\'{monthId:' + list[i].month + ',maintenanceType:1}\',\'' + list[i].upkeepDateCount + '\')">' +
                                fix0(list[i].upkeepDateCount) + '</td>' +
                                '<td class="tr' + (list[i].upkeepInfoCount ? ' spanTitle' : '') +
                                '" onclick="$containerObj.modalObj.query(\'actual-record\',\'{monthId:' + list[i].month + ',maintenanceType:1}\',\'' + list[i].upkeepInfoCount + '\')">' +
                                fix0(list[i].upkeepInfoCount) + '</td>' +
                                '<td class="tr' + (list[i].upkeepDateAssetsCount ? ' spanTitle' : '') +
                                '" onclick="$containerObj.modalObj.query(\'plan-device\',\'{monthId:' + list[i].month + ',maintenanceType:1}\',\'' + list[i].upkeepDateAssetsCount + '\')">' +
                                fix0(list[i].upkeepDateAssetsCount) + '</td>' +
                                '<td class="tr' + (list[i].upkeepInfoAssetsCount ? ' spanTitle' : '') +
                                '" onclick="$containerObj.modalObj.query(\'actual-device\',\'{monthId:' + list[i].month + ',maintenanceType:1}\',\'' + list[i].upkeepInfoAssetsCount + '\')">' +
                                fix0(list[i].upkeepInfoAssetsCount) + '</td>' +
                                '<td class="tr">' + fix2(list[i].upkeepPercentage) + '</td>' +
                                '<td class="tr">' + fix2(list[i].upkeepTimelyPercentage) + '</td>' +
                                '</tr>'
                            );
                        } else if ($containerObj.maintenanceType === '2') { // 巡检
                            tbodyStr += (
                                '<td class="tr' + (list[i].inspectionDateCount ? ' spanTitle' : '') +
                                '" onclick="$containerObj.modalObj.query(\'plan-record\',\'{monthId:' + list[i].month + ',maintenanceType:2}\',\'' + list[i].inspectionDateCount + '\')">' +
                                fix0(list[i].inspectionDateCount) + '</td>' +
                                '<td class="tr' + (list[i].inspectionInfoCount ? ' spanTitle' : '') +
                                '" onclick="$containerObj.modalObj.query(\'actual-record\',\'{monthId:' + list[i].month + ',maintenanceType:2}\',\'' + list[i].inspectionInfoCount + '\')">' +
                                fix0(list[i].inspectionInfoCount) + '</td>' +
                                '<td class="tr' + (list[i].inspectionDateAssetsCount ? ' spanTitle' : '') +
                                '" onclick="$containerObj.modalObj.query(\'plan-device\',\'{monthId:' + list[i].month + ',maintenanceType:2}\',\'' + list[i].inspectionDateAssetsCount + '\')">' +
                                fix0(list[i].inspectionDateAssetsCount) + '</td>' +
                                '<td class="tr' + (list[i].inspectionInfoAssetsCount ? ' spanTitle' : '') +
                                '" onclick="$containerObj.modalObj.query(\'actual-device\',\'{monthId:' + list[i].month + ',maintenanceType:2}\',\'' + list[i].inspectionInfoAssetsCount + '\')">' +
                                fix0(list[i].inspectionInfoAssetsCount) + '</td>' +
                                '<td class="tr">' + fix2(list[i].inspectionPercentage) + '</td>' +
                                '<td class="tr">' + fix2(list[i].inspectionTimelyPercentage) + '</td>' +
                                '</tr>'
                            );
                        } else if ($containerObj.maintenanceType === '3') { // 强检
                            tbodyStr += (
                                '<td class="tr' + (list[i].compulsoryDateCount ? ' spanTitle' : '') +
                                '" onclick="$containerObj.modalObj.query(\'plan-record\',\'{monthId:' + list[i].month + ',maintenanceType:3}\',\'' + list[i].compulsoryDateCount + '\')">' +
                                fix0(list[i].compulsoryDateCount) + '</td>' +
                                '<td class="tr' + (list[i].compulsoryVerificationCount ? ' spanTitle' : '') +
                                '" onclick="$containerObj.modalObj.query(\'actual-record\',\'{monthId:' + list[i].month + ',maintenanceType:3}\',\'' + list[i].compulsoryVerificationCount + '\')">' +
                                fix0(list[i].compulsoryVerificationCount) + '</td>' +
                                '<td class="tr' + (list[i].compulsoryDateAssetsCount ? ' spanTitle' : '') +
                                '" onclick="$containerObj.modalObj.query(\'plan-device\',\'{monthId:' + list[i].month + ',maintenanceType:3}\',\'' + list[i].compulsoryDateAssetsCount + '\')">' +
                                fix0(list[i].compulsoryDateAssetsCount) + '</td>' +
                                '<td class="tr' + (list[i].compulsoryVerificationAssetsCount ? ' spanTitle' : '') +
                                '" onclick="$containerObj.modalObj.query(\'actual-device\',\'{monthId:' + list[i].month + ',maintenanceType:3}\',\'' + list[i].compulsoryVerificationAssetsCount + '\')">' +
                                fix0(list[i].compulsoryVerificationAssetsCount) + '</td>' +
                                '<td class="tr">' + fix2(list[i].compulsoryPercentage) + '</td>' +
                                '<td class="tr">' + fix2(list[i].compulsoryTimelyPercentage) + '</td>' +
                                '</tr>'
                            );
                        }
                    }
                }
                var table, thead, tbody, tfoot, main;
                if (tag === 'year') {
                    table = $this.yearTable;
                    thead = $this.yearThead;
                    tbody = $this.yearTbody;
                    tfoot = $this.yearTfoot;
                    main = $this.yearMain;
                } else {
                    table = $this.table;
                    thead = $this.thead;
                    tbody = $this.tbody;
                    tfoot = $this.tfoot;
                    main = $this.main;
                }
                thead.html(theadStr);
                tbody.html(tbodyStr);
                tfoot.html(tfootStr);
                /* 排序 */
                // 添加排序图片
                var sort = thead.find('.sort').append('<img src="' + basePath + 'plugins/charts/images/sort.png">').each(function () {
                    if (key === $(this).data().key) { // 根据sorting和key设置排序字段图片
                        $(this).find('img').attr('src', basePath + 'plugins/charts/images/sort_' + (sorting === 'desc' ? 'up' : 'down') + '.png');
                    }
                });
                /* 点击表头重新排序 */
                sort.on('click', function () {
                    var src = $(this).find('img').attr('src');
                    if (src.indexOf('sort_up.png') !== -1) {
                        $containerObj.modalObj.setModal(tag, $(this).data().key, 'asc');
                    } else if ((src.indexOf('sort_down.png') !== -1) || (src.indexOf('sort.png') !== -1)) {
                        $containerObj.modalObj.setModal(tag, $(this).data().key, 'desc');
                    }
                });
                main.iziModal('open');
                // 延时设置表格首尾固定，防止页面卡死
                setTimeout(function () {
                    // 如果列表长度大于200，则值固定表头表尾，不固定前两列，防止页面卡死
                    if (list.length > 200) {
                        table.tableHeadFixer({'head': true, 'foot': true});
                    } else {
                        table.tableHeadFixer({'left': 2, 'head': true, 'foot': true});
                    }
                    loading(true);
                }, 20);
            }, 20);
        },
        /* 绑定事件 */
        bindEvent: function () {
            var $this = this;
            // 点击详情按钮，设置对应数据，弹出模态框
            $containerObj.main.find('.detail-btn').on('click', function () {
                var tag = $(this).data().tag;
                $this.setModal(tag, '', 'desc');
            })
        },
        /* 处理新增、报废、设备的点击 */
        query: function (tag, params, count) {
            if (count > 0) {
                var $this = this;
                loading(function () {
                    if ($containerObj.maintenanceType === '1') {
                        $this.assetsMain.iziModal('setTitle', $.i18n.prop('share.talbe.sbbyxq'));
                    } else if ($containerObj.maintenanceType === '2') {
                        $this.assetsMain.iziModal('setTitle', $.i18n.prop('share.talbe.sbxjxq'));
                    } else if ($containerObj.maintenanceType === '3') {
                        $this.assetsMain.iziModal('setTitle', $.i18n.prop('share.talbe.sbqjxq'));
                    }
                    params = string2json(params);
                    if (tag === 'plan-record') {
                        $this.queryAssetsTable('plan/record', params);
                    } else if (tag === 'actual-record') {
                        $this.queryAssetsTable('actual/record', params);
                    } else if (tag === 'plan-device') {
                        $this.queryAssetsTable('plan/assets', params);
                    } else if (tag === 'actual-device') {
                        $this.queryAssetsTable('actual/assets', params);
                    }
                });
            }
        },
        /* 查询设备、新增、报废数据 */
        queryAssetsTable: function (url, params) {
            var $this = this;
            publicAjax(basePath + 'charts/area/maintenance/' + url, 'post', $.extend({}, $headerObj.searchObj.params, params), function (data) {
                $this.data.count = data.data;
                $this.setAssetsTable('', 'desc', url);
            }, true);
        },
        /* 设置设备、新增、报废表格数据 */
        setAssetsTable: function (key, sorting, tag) {
            var $this = this,
                theadStr = '',
                tbodyStr = '',
                tfootStr = '',
                list = (this.data.count.list || []).calTotal().sortByKey(sorting, key);
            loading();
            theadStr = (
                '<tr><th class="tc">#</th>' +
                '<th class="sort tl" data-key="name">'+$.i18n.prop('share.table.head.sbmc')+'</th>' +
                '<th class="sort tl" data-key="modalName">'+$.i18n.prop('share.assets.sbxh')+'</th>' +
                '<th class="sort tl" data-key="firstTypeName">'+$.i18n.prop('share.table.head.sblx')+'</th>' +
                '<th class="sort tl" data-key="hospital">'+$.i18n.prop('share.assets.ssyy')+'</th>' +
                '<th class="sort tl" data-key="department">'+$.i18n.prop('share.assets.ssks')+'</th>' +
                '<th class="sort tl" data-key="manufacturer">'+$.i18n.prop('share.table.head.sbcj')+'</th>' +
                '<th class="sort tl" data-key="sn">'+$.i18n.prop('share.assets.snbh')+'</th>' +
                '<th class="sort tl" data-key="assetsNo">'+$.i18n.prop('share.assets.zcbh')+'</th>' +
                '<th class="sort tl" data-key="enableDate">'+$.i18n.prop('share.assets.sbqyrq')+'</th>' +
                '<th class="sort tr" data-key="price">'+$.i18n.prop('share.assets.sbje(wy)')+'</th>' +
                (function () {
                    var str = '';
                    if ($containerObj.maintenanceType === '1') {
                        str += '<th class="sort tl" data-key="upkeepCycle">'+$.i18n.prop('maintenance.assets.byzq')+'</th>';
                        if (tag === 'plan/record') {
                            str += '<th class="sort tl" data-key="expectedDate">'+$.i18n.prop('maintenance.assets.jhbysj')+'</th>';
                        } else if (tag === 'actual/record') {
                            str += '<th class="sort tl" data-key="expectedDate">'+$.i18n.prop('maintenance.assets.jhbysj')+'</th>' +
                                '<th class="sort tl" data-key="completeDate">'+$.i18n.prop('maintenance.assets.sjbysj')+'</th>';
                        }
                    } else if ($containerObj.maintenanceType === '2') {
                        str += '<th class="sort tl" data-key="inspectionCycle">'+$.i18n.prop('maintenance.assets.xjzq')+'</th>';
                        if (tag === 'plan/record') {
                            str += '<th class="sort tl" data-key="expectedDate">'+$.i18n.prop('maintenance.assets.jhxjsj')+'</th>';
                        } else if (tag === 'actual/record') {
                            str += '<th class="sort tl" data-key="expectedDate">'+$.i18n.prop('maintenance.assets.jhxjsj')+'</th>' +
                                '<th class="sort tl" data-key="completeDate">'+$.i18n.prop('maintenance.assets.sjxjsj')+'</th>';
                        }
                    }  else if ($containerObj.maintenanceType === '3') {
                        str += '<th class="sort tl" data-key="verificationCycle">'+$.i18n.prop('maintenance.assets.qjzq')+'</th>';
                        if (tag === 'plan/record') {
                            str += '<th class="sort tl" data-key="expectedDate">'+$.i18n.prop('maintenance.assets.jhqjsj')+'</th>';
                        } else if (tag === 'actual/record') {
                            str += '<th class="sort tl" data-key="expectedDate">'+$.i18n.prop('maintenance.assets.jhqjsj')+'</th>' +
                                '<th class="sort tl" data-key="completeDate">'+$.i18n.prop('maintenance.assets.sjqjsj')+'</th>';
                        }
                    }
                    return str;
                })() +
                '<th class="sort tl" data-key="qrcode">'+$.i18n.prop('maintian.record.ewm')+'</th>' +
                '<th class="sort tr" data-key="usedTime">'+$.i18n.prop('share.assets.ysysj(n)')+'</th>' +
                '<th class="sort tr" data-key="ageLimitMeasure">'+$.i18n.prop('share.assets.nxzs')+'</th>' +
                '</tr>'
            );
            tfootStr = (
                '<tr>' +
                '<td class="tc">'+$.i18n.prop('share.table.tail.zj')+'</td>' +
                '<td class="tl">' + list.length + '</td>' +
                '<td class="tl"></td>' +
                '<td class="tl"></td>' +
                '<td class="tl"></td>' +
                '<td class="tl"></td>' +
                '<td class="tl"></td>' +
                '<td class="tl"></td>' +
                '<td class="tl"></td>' +
                '<td class="tl"></td>' +
                '<td class="tr">' + fix2(list[-1].price / PRICE_CONVERT) + '</td>' +
                '<td class="tl"></td>' +
                (function () {
                    var str = '';
                    if (tag === 'plan/record') {
                        str += '<td class="tl"></td>';
                    } else if (tag === 'actual/record') {
                        str += '<td class="tl"></td>' +
                            '<td class="tl"></td>';
                    }
                    return str;
                })() +
                '<td class="tl"></td>' +
                '<td class="tr">' + fix2(list[-1].usedTime / list.length) + '</td>' +
                '<td class="tr">' + fix2(list[-1].ageLimitMeasure / list.length) + '</td>' +
                '</tr>'
            );
            for (var i = 0; i < list.length; i++) {
                tbodyStr += (
                    '<tr>' +
                    '<td class="tc">' + (i + 1) + '</td>' +
                    '<td class="spanTitle" onclick="$containerObj.query(\'assets\',\'' + list[i].id + '\')">' + fixStr(list[i].assetsName) + '</td>' +
                    '<td class="tl">' + fixStr(list[i].model) + '</td>' +
                    '<td class="tl">' + fixStr(list[i].firstTypeName) + '</td>' +
                    '<td class="tl">' + fixStr(list[i].hospitalName) + '</td>' +
                    '<td class="tl">' + fixStr(list[i].departmentName) + '</td>' +
                    '<td class="tl">' + fixStr(list[i].manufacturer) + '</td>' +
                    '<td class="tl">' + fixStr(list[i].sn) + '</td>' +
                    '<td class="tl">' + fixStr(list[i].assetsNo) + '</td>' +
                    '<td class="tl">' + fixStr(list[i].enableDate) + '</td>' +
                    '<td class="tr">' + fix2(list[i].price / PRICE_CONVERT) + '</td>' +
                    (function () {
                        var str = '';
                        if ($containerObj.maintenanceType === '1') {
                            str += '<td class="tl">' + fixStr(list[i].upkeepCycle) + '</td>';
                            if (tag === 'plan/record') {
                                str += '<td class="tl">' + fixStr(list[i].expectedDate) + '</td>';
                            } else if (tag === 'actual/record') {
                                str += '<td class="tl">' + fixStr(list[i].expectedDate) + '</td>' +
                                    '<td class="tl">' + fixStr(list[i].completeDate) + '</td>';
                            }
                        } else if ($containerObj.maintenanceType === '2') {
                            str += '<td class="tl">' + fixStr(list[i].inspectionCycle) + '</td>';
                            if (tag === 'plan/record') {
                                str += '<td class="tl">' + fixStr(list[i].expectedDate) + '</td>';
                            } else if (tag === 'actual/record') {
                                str += '<td class="tl">' + fixStr(list[i].expectedDate) + '</td>' +
                                    '<td class="tl">' + fixStr(list[i].completeDate) + '</td>';
                            }
                        } else if ($containerObj.maintenanceType === '3') {
                            str += '<td class="tl">' + fixStr(list[i].verificationCycle) + '</td>';
                            if (tag === 'plan/record') {
                                str += '<td class="tl">' + fixStr(list[i].expectedDate) + '</td>';
                            } else if (tag === 'actual/record') {
                                str +=  '<td class="tl">' + fixStr(list[i].expectedDate) + '</td>' +
                                    '<td class="tl">' + fixStr(list[i].completeDate) + '</td>';
                            }
                        }
                        return str;
                    })() +
                    '<td class="tl">' + fixStr(list[i].qrcode) + '</td>' +
                    '<td class="tr">' + fix2(list[i].usedTime) + '</td>' +
                    '<td class="tr">' + fix2(list[i].ageLimitMeasure) + '</td>' +
                    '</tr>'
                );
            }
            $this.assetsThead.html(theadStr);
            $this.assetsTbody.html(tbodyStr);
            $this.assetsTfoot.html(tfootStr);
            /* 排序 */
            var sort = $this.assetsThead.find('.sort').append('<img src="' + basePath + 'plugins/charts/images/sort.png">').each(function () {
                if (key === $(this).data().key) {
                    $(this).find('img').attr('src', basePath + 'plugins/charts/images/sort_' + (sorting === 'desc' ? 'up' : 'down') + '.png');
                }
            });
            sort.on('click', function () {
                var src = $(this).find('img').attr('src');
                if (src.indexOf('sort_up.png') !== -1) {
                    $containerObj.modalObj.setAssetsTable($(this).data().key, 'asc', tag);
                } else if ((src.indexOf('sort_down.png') !== -1) || (src.indexOf('sort.png') !== -1)) {
                    $containerObj.modalObj.setAssetsTable($(this).data().key, 'desc', tag);
                }
            });
            $this.assetsMain.iziModal('open');
            setTimeout(function () {
                if (list.length > 200) {
                    $this.assetsTable.tableHeadFixer({'head': true, 'foot': true});
                } else {
                    $this.assetsTable.tableHeadFixer({'left': 2, 'head': true, 'foot': true});
                }
                loading(true);
            }, 20);
        }
    };
});